We conceived the idea for this hack when reading the list of hardware that was going to be available for this hack day. Among them was a raspberry pie that could be turned into an iBeacon very easily. An appealing thought was that we could join the event of people coming into a range of each other and the festive setting into a meaningful context. Playing festive tunes in a polyphonic orchestra of users devices seemed like a perfect fit for this proposition. We set out by looking at implementations of communications protocols and quickly discovered that Bluetooth_LE was not going to fit the bill, as we were going to have to:
This file contains 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
combination of: | |
http://stackoverflow.com/questions/363908/how-do-i-use-git-rebase-i-to-rebase-all-changes-in-a-branch | |
http://stackoverflow.com/questions/5189560/how-can-i-squash-my-last-x-commits-together-using-git | |
git merge-base feature master | |
git reset --hard output of above sha | |
git merge --squash HEAD@{1} | |
git commit |
This file contains 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
public class DisposableClass : | |
IDisposable | |
{ | |
bool _disposed; | |
public void Dispose() | |
{ | |
Dispose(true); | |
GC.SuppressFinalize(this); | |
} |
This file contains 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
member x.HandleExceptionOrContinue(t : Task) = | |
match t.IsFaulted with | |
| true -> | |
tracer.WriteLine( | |
(sprintf "Unhandled Exception when trying to send message: %O" | |
(t.Exception)), LogError); raise t.Exception | |
| arg -> () | |
call it with | |
t.ContinueWith( |
This file contains 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
member x.ContinueUnitTaskSafe (writer : (string -> unit) option) (t : Task) = | |
match t.IsFaulted with | |
| true -> | |
match writer with | |
| Some x -> x "reraising" | |
| None -> () | |
raise t.Exception | |
| arg -> () |
This file contains 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
Param( $serviceName = "", | |
$storageAccountName = "", | |
$packageLocation = "", | |
$cloudConfigLocation = "", | |
$environment = "Staging", | |
$deploymentLabel = "ContinuousDeploy to $servicename", | |
$timeStampFormat = "g", | |
$alwaysDeleteExistingDeployments = 1, | |
$enableDeploymentUpgrade = 1, | |
$selectedsubscription = "default", |
This file contains 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
// Loop through each byte of the hashed data | |
// and format each one as a hexadecimal string. | |
for (int i = 0; i < data.Length; i++) | |
{ | |
sBuilder.Append(data[i].ToString("x2")); | |
} |
This file contains 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
# You may want to use another dir than /tmp | |
cd /tmp | |
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout azure-private.key -out azure-certificate.pem | |
chmod 600 azure-private.key azure-certificate.pem | |
openssl x509 -outform der -in azure-certificate.pem -out azure-certificate.cer | |
# Generate a keystore (azurekeystore.pkcs12) | |
# Transform private key to PEM format | |
openssl pkcs8 -topk8 -nocrypt -in azure-private.key -inform PEM -out azure-pk.pem -outform PEM | |
# Transform certificate to PEM format |
This file contains 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
module Seq = | |
let private spill (n:int) (s:seq<'a>) = | |
let en = s.GetEnumerator() | |
let pos = ref 0 | |
let lst = [ while !pos < n && en.MoveNext() do | |
pos := !pos+1 | |
yield en.Current] | |
if lst |> List.isEmpty then None else | |
Some((lst, seq { while en.MoveNext() do yield en.Current})) |
This file contains 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
ilmerge /t:exe /targetplatform:"v4,$env:windir\Microsoft.NET\Framework64\v4.0.30319" /lib:. /out:Upload.exe .\lsul.exe |