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.Diagnostics; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Machine.Specifications; | |
namespace ringbuffer | |
{ |
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 Symbiote.Core; | |
using Symbiote.Http; | |
using Symbiote.Http.Impl; | |
using Symbiote.Http.Owin; | |
using Symbiote.StructureMap; | |
using Symbiote.Daemon; | |
using Symbiote.Messaging; | |
using Symbiote.Actor; |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Assimilate | |
.Core<StructureMapAdapter>() | |
.AddConsoleLogger<RiakService>( x => x.Info().MessageLayout( m => m.Message().Newline() ) ) | |
.Messaging() | |
.Daemon( x => x.Arguments( args ).Name( "Riak Demo" ) ) | |
.Riak( x => x.AddNode( r => r.Address( "192.168.1.100" ) ) ) |
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
handle_request(Req) -> | |
#req{uri={_,Uri}} = Req:raw(), | |
Ext=filename:extension(Uri), | |
handle_request(Req, Uri, Ext). | |
handle_request(Req, _Uri, []) -> | |
Segments = Req:resource([urldecode]), | |
Method = get_atom(Req:get(method)), | |
[Resource|Arguments]=Segments, | |
ResourceModule = get_atom(Resource), |
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
sys = require "sys" | |
rabbit = require "amqp" | |
console.log "Connecting to rabbit..." | |
connection = rabbit.createConnection { host: "localhost", port: 5672 } | |
connection.on "ready", () -> | |
exchangeOptions = { type: "fanout", autoDelete: true } | |
connection.exchange( |
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
Action<IList<XElement>> saveAction = SaveChunk; | |
var loader = new BulkPostLoader(@"e:\stackoverflow\062010 so\posts.xml"); | |
var batches = loader.BufferWithCount(5000); | |
var results = batches.Select(x => saveAction.BeginInvoke(x, null, null)); | |
results | |
.Aggregate(new HashSet<IAsyncResult>(), (set, result) => | |
{ | |
set.RemoveWhere(x => x.IsCompleted); | |
set.Add(result); |
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
var DomWriter = function (target, namespace) { | |
var instance = this; | |
var template = namespace; | |
var coalesce = function( value, defaultValue ) { | |
return typeof(value) != 'undefined' ? | |
value : defaultValue; | |
}; | |
this.isObject = function( value ) { |
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
zlib = require 'zlib' | |
module.exports = (robot) -> | |
robot.respond /(stack|ss) ?(find:.*) ?(tags:.*)/i, (msg)-> | |
query = msg.match[2] | |
query2 = msg.match[3] | |
query = query.replace /find:/i, "" | |
query2 = query2.replace /tags:/i, "" |
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
These URLs should be to the actual script files and can be used for to populate tools like JS Fiddle. | |
Cartographer: | |
https://raw.github.com/arobson/cartographer.js/master/lib/cartographer.min.js | |
jQuery: | |
http://code.jquery.com/jquery-1.7.1.min.js | |
Underscore: | |
https://raw.github.com/documentcloud/underscore/master/underscore-min.js |
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
$.mockjax( { | |
url: "http://api.github.com/users/arobson", | |
type: "GET", | |
status: 200, | |
data: { | |
"name": "Alex Robson", | |
"company": "appendTo", | |
"public_repos": 31, | |
"followers": 18, | |
"following": 4, |
OlderNewer