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
Observable.FromEvent((EventHandler<SensorReadingEventArgs<CompassReading>> e) => new EventHandler<SensorReadingEventArgs<CompassReading>>(e), | |
e => compass.CurrentValueChanged += e, | |
e => compass.CurrentValueChanged -= e) |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
public class Default | |
{ | |
public static void Main(string[] args) | |
{ | |
Console.WriteLine("how you like these nuts"); |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<pre><script type="text/javascript"> | |
try { | |
document.createElement("div").style.setProperty("width", 216, ""); | |
document.write("CSSStyleDeclaration's setProperty coerces strings. Hooray!\n"); | |
} catch (error) { | |
document.write("CSSStyleDeclaration's setProperty requires strings. Patching…\n"); |
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
Weekend project: A little Nancy (http://nancyfx.org) extension which exposes your methods in C# as async calls in Javascript. I really like what Now.js is doing for RPC on Node and want to clone it, so this weekend's task was a fun proof of concept. | |
All you need to do is subclass my thing and write some public methods:<br> | |
http://i.imgur.com/NnqQo.png | |
Then in your page, include 'nanio.js' which is emitted by my lib (and JQuery, currently the sole external dependency since I'm not currently interested in rewriting ajax handling | |
http://i.imgur.com/TNlhX.png | |
And then your calls work! Yay! | |
http://i.imgur.com/1TuZa.png |
NewerOlder