This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package sample.cluster.simple | |
| import scala.concurrent.duration._ | |
| import akka.actor._ | |
| import akka.cluster.Cluster | |
| import akka.cluster.ClusterEvent._ | |
| import akka.routing.FromConfig | |
| import com.typesafe.config.ConfigFactory | |
| object SimpleRouterApp { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Export documents to csv | |
| mongoexport -d database_name -c collection_name -f field1,field2,field3 -q '{"created_at":{"$gt": new Date(1373913000000), "$lt": new Date(1375036200000)}}' --csv -o docs.csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dim list As IList(Of String) = text.Split(" ") | |
| Dim number As String = "" | |
| For Each entry In list | |
| If Char.IsDigit(entry) Then | |
| number = entry | |
| Exit For | |
| End If | |
| Next | |
| If number = 1 Then | |
| Return True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git diff 1.0.2 HEAD --stat=200 | |
| git diff 1.0.2 HEAD --stat=500 | where {$_ -Match ".cshtml|.css"} | %{$line=$_.split(" "); write-host $line[1] } | |
| git diff 1.0.2 HEAD --stat=200 | where {$_ -Match ".cshtml|.cs"} | %{$l=$_.split(" "); $file=$l[1]; $file=$file.replace("Umbraco.Site", ""); write-host $file } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\SystemCore\VSCore\On Access Scanner\McShield\Configuration\Default" /v "ScanArchives" /t REG_DWORD /d 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (C) 2013 Scott Weber | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Styled like the default prompt in Ubuntu 9.04 Jaunty | |
| # Cloned by Steve Gargan | |
| # | |
| prompt_ubuntu_setup () | |
| { | |
| local userhost=${1:-'green'} | |
| local cwd=${2:-'blue'} | |
| PS1="%B%F{$userhost}%n@%m%F{$cwd%}:%~%# %b%k%f" | |
| PS2="> " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE TestDB.dbo.CacheItem( | |
| CacheItemID INT PRIMARY KEY, | |
| Name VARCHAR(255) UNIQUE NOT NULL, | |
| Value VARCHAR(4000), | |
| Value_Type VARCHAR(255) NOT NULL, | |
| Expires DATETIME | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In order for this to work you need ffmpeg. I tried with version 1.2.1. | |
| 1) Play the video you want to download in the browser | |
| 2) Inspect the video element on the page | |
| 3) Copy the video url from the page source (something like http://devstreaming.apple.com/videos/wwdc/2013/.../101/ref.mov) | |
| 4) In this url replace "ref.mov" with "iphone_c.m3u8" (for 960x540 resolution) or "atp.m3u8" if you want more (probably 720p?) | |
| 5) Execute `ffmpeg -y -i http://devstreaming.apple.com/videos/wwdc/2013/.../101/iphone_c.m3u8 output.mp4` | |
| 6) There is your video :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import scala.pickling._ | |
| import scala.reflect.runtime.universe._ | |
| import scala.util.parsing.json._ | |
| import scala.collection.mutable.{StringBuilder, Stack} | |
| package object edn { | |
| implicit val pickleFormat: EdnPickleFormat = new EdnPickleFormat | |
| } |
NewerOlder