Skip to content

Instantly share code, notes, and snippets.

Observable.FromEvent((EventHandler<SensorReadingEventArgs<CompassReading>> e) => new EventHandler<SensorReadingEventArgs<CompassReading>>(e),
e => compass.CurrentValueChanged += e,
e => compass.CurrentValueChanged -= e)
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");
<!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");
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