Skip to content

Instantly share code, notes, and snippets.

View rajeshpillai's full-sized avatar

Rajesh Pillai rajeshpillai

View GitHub Profile
@rajeshpillai
rajeshpillai / awful.js
Created April 13, 2012 19:05 — forked from mxriverlynn/awful.js
Improve This Backbone "Query"
// A home has floors.
// A floor has rooms.
// A room has device groups.
// A device group has devices.
// A device has addresses.
// An address has actual address value.
//
// So, the purpose of this awful mess is to say :
// "give me every device with this address, from any home"
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Reflection.Emit;
using System.Collections.Concurrent;
using System.Data;
using System.Reflection;

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
/// <summary>
/// Extension method that turns a dictionary of string and object to an ExpandoObject
/// </summary>
public static ExpandoObject ToExpando(this IDictionary<string, object> dictionary)
{
var expando = new ExpandoObject();
var expandoDic = (IDictionary<string, object>)expando;
// go through the items in the dictionary and copy over the key value pairs)
foreach (var kvp in dictionary)
@rajeshpillai
rajeshpillai / gesture.js
Last active August 29, 2015 14:07 — forked from eguneys/gesture.js
'use strict';
define(['phaser'], function(Phaser) {
function Gesture(game) {
this.game = game;
this.swipeDispatched = false;
this.holdDispatched = false;
this.isTouching = false;
@rajeshpillai
rajeshpillai / gear.md
Last active August 29, 2015 14:10 — forked from joelhooks/gear.md
@rajeshpillai
rajeshpillai / _.md
Last active August 29, 2015 14:18
Tributary inlet
@rajeshpillai
rajeshpillai / _.md
Last active August 29, 2015 14:18
Tributary inlet
@rajeshpillai
rajeshpillai / _.md
Last active August 29, 2015 14:18
Tributary inlet
@rajeshpillai
rajeshpillai / _.md
Last active August 29, 2015 14:18
Tributary inlet