Skip to content

Instantly share code, notes, and snippets.

View joshrobb's full-sized avatar

Josh Robb joshrobb

  • Auckland, New Zealand
View GitHub Profile
if [ `ssh $MY_HOST ps aux | awk '{sum+=$6}; END {print sum}'` -gt $RAM_LIMIT ]; then growlnotify -m "Some message"; fi ;
using NUnit.Framework;
using System;
namespace Castle.Windsor.Tests.SubContainers
{
[TestFixture]
public class ChildContainerSingleResolutionTestCase
{
private IWindsorContainer parentContainer;
private IWindsorContainer childContainer;
using System;
using ExtensionMethods;
namespace Events
{
public static class DomainEvents
{
private static IEventHandlerResolver _handlerResolver;
public static bool IsInitialised()
using System;
using System.Web.Mvc;
using V2.Domain.Services;
using V2.Domain.Services.Messages;
using MvcContrib.Attributes;
using System.Linq;
namespace V2.Web.Controllers
{
public class RegistrationController : ControllerBase
using System;
using ExtensionMethods;
namespace Events
{
public static class DomainEvents
{
private static IEventHandlerResolver _handlerResolver;
public static bool IsInitialised()
public abstract class Thing
{
}
public interface IMarker {}
public interface IUseful<T> : IMarker where T : Thing
{
T DoSomething();
}
var Suteki = Suteki || {};
Suteki.new_eventBus = (function(){
var self = {};
var subscriptions = {};
var unsubscribeTokens = [];
var subscriptionPointers = [];
# How we store all time views across the entire system for http://gauge.es.
# All in one document that gets incremented using MongoDB $inc modifier in
# every track. The $inc increments t, year.t, year.month.t, year.month.day.t
# so we get to the day numbers. These are in EST, as we are in EST and these
# stats are just for us. :) Nothing amazing, but thought I would share.
#
# >> pp View.all_time
{
"_id" => "all_time",
"t" => 502352,
defaults write com.twitter.twitter-mac UserTimelineDerepeater -bool true
defaults write com.twitter.twitter-mac ScrollingMakesKeyAndOrdersFront -bool true
defaults write com.twitter.twitter-mac TypeAnywhereToTweet -bool true
defaults write com.twitter.twitter-mac HideInBackground -bool true
defaults write com.twitter.twitter-mac NormalComposeWindowLevel -bool false
defaults write com.twitter.twitter-mac ESCClosesComposeWindow -bool true
/*
Subject / EventLoopScheduler / CompositeDisposable are all from the Reactive Library for .Net 3.5.
Most of these classes are baked into .NET 4 AFAIK
*/
// Event loop and queue setup done in constructor
_sendQueue = new Subject<Action>();
var scheduler = new EventLoopScheduler( "EmailSender" );
var queueSubscription = _sendQueue.ObserveOn( scheduler ).Subscribe( action => action() );
_queueCleanup = new CompositeDisposable( queueSubscription, scheduler );