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
namespace MakeMyDay | |
{ | |
public interface ICommand { } | |
public interface ICommandHandler<T> where T : ICommand | |
{ | |
void Handle(T cmd); | |
} | |
public interface ICommandValidator<T> where T : ICommand |
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
function microAjax(url, callbackFunction) { | |
var o = {}; | |
o.bindFunction = function (caller, object) { | |
return function () { | |
return caller.apply(object, [object]); | |
}; | |
}; | |
o.stateChange = function (object) { | |
if (o.request.readyState == 4) | |
o.callbackFunction(o.request.responseText); |
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
// collection.Add(new RegexRoute("(^|[a-z0-9/]*/)[0-9]+/[0-9]+/[0-9]+/[a-z0-9_.-]*__([0-9]+)/flush$", "sectionpath,pageid", new { controller = "misc", action = "flush" }, new MvcRouteHandler())); | |
public class RegexRoute : RouteBase | |
{ | |
private readonly string _match; | |
private readonly string _names; | |
private readonly RouteValueDictionary _defaults; | |
private readonly IRouteHandler _handler; | |
public RegexRoute(string match, string names, object defaults, IRouteHandler handler) |
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
function Simulator(){ | |
var ret = {} | |
var _callback = undefined; | |
var _queue = []; | |
var _counter = 0; | |
ret.fireCallback = function(json) { | |
// console.log('Fire event '+json); | |
if( _callback ) _callback(json); | |
} |
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
tail -f ~/Documents/Colloquy\ Transcripts/* | awk 'BEGIN{FS="</event>";OFS="</event>\n\n"}{$1=$1}1' | python parse.py |
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 re | |
import subprocess | |
import os | |
voices = ['Agnes','Kathy','Princess','Vicki','Victoria','Bruce','Fred','Junior','Ralph'] | |
def voiceFromName(name): | |
x = 0 | |
for c in name: |
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
<html> | |
<head> | |
<link rel="stylesheet" href="sp://import/css/eve.css" /> | |
<script src="jquery.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
sp = getSpotifyApi(1); | |
var m = sp.require("sp://import/scripts/api/models"); |
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
#include <SPI.h> | |
#include <Ethernet.h> | |
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial(8, 9); | |
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x88 }; | |
IPAddress server(91,123,198,230); // Google | |
int port = 80; | |
EthernetClient client; | |
int sent = 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
Array.prototype.mapAsync = function(mapper, finalcallback) { | |
var waiting = 0; | |
var that = this; | |
var newlist = []; | |
this.forEach(function(item) { | |
// console.log('starting async mapper', item); | |
waiting ++; | |
setTimeout(function() { | |
mapper(item, function(newitem) { |
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
Array.prototype.mapAsync = function(mapper, finalcallback, timeout) { | |
var mappertimeout = timeout || 10000; | |
var waiting = 0; | |
var that = this; | |
var newlist = []; | |
var _donecallback = function() { | |
waiting --; | |
console.log('after async mapper done'); | |
if (waiting === 0) { |