Skip to content

Instantly share code, notes, and snippets.

/// <summary>
/// ALL of this was copied directly out of Nancy.Owin.dll's source:
/// https://github.com/NancyFx/Nancy/blob/master/src/Nancy.Owin/NancyOwinHost.cs
///
/// For the SOLE PURPOSE of customizving:
/// var nancyRequestStream = new RequestStream(owinRequestBody, ExpectedLength(owinRequestHeaders), 1048576, false);
/// </summary>
namespace FunkyTown
{
using System;
App.PushClient = Em.Object.extend
members: prop ->
Em.A()
connect: (key, userId) ->
return unless Pusher?
@pusher?.disconnect()
@pusher = new Pusher key,
@aaronlerch
aaronlerch / 0_reuse_code.js
Created August 15, 2014 17:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aaronlerch
aaronlerch / overviewer.conf
Last active August 29, 2015 14:12
Example configuration and update script for running The Minecraft Overviewer and uploading it to S3
worlds["myserver"] = "/opt/msm/servers/myserver/world"
def playerIcons(poi):
if poi['id'] == 'Player':
poi['icon'] = "http://overviewer.org/avatar/%s" % poi['EntityId']
return "Last known location for %s" % poi['EntityId']
def signFilter(poi):
if poi['id'] == 'Sign':
return "\n".join([poi['Text1'], poi['Text2'], poi['Text3'], poi['Text4']])
### Keybase proof
I hereby claim:
* I am aaronlerch on github.
* I am aaronlerch (https://keybase.io/aaronlerch) on keybase.
* I have a public key whose fingerprint is 4D45 4934 A0A0 1E9D 61FA EC85 9AD4 01C7 C20F 3B87
To claim this, I am signing this object:
@aaronlerch
aaronlerch / Gemfile
Last active August 29, 2015 14:16
blink1 + guard = simple test status indicator
# ...
group :development, :test do
# ...
gem "guard", require: false
gem "guard-shell", require: false
# ...
end
# ...
@aaronlerch
aaronlerch / gist:1171640
Created August 25, 2011 19:42
Calling Twilio from Powershell
[System.Reflection.Assembly]::LoadFile("path to twilio assembly") | out-null
$twilio = new-object Twilio.TwilioRestClient("accountSid", "authToken")
$msg = $twilio.SendSmsMessage("+15551112222", "+15553334444", "Can you believe it's this easy to send an SMS?!")
@aaronlerch
aaronlerch / gist:1464878
Created December 12, 2011 04:29
Hmmm, no?
# Run at 11:28 PM on Sunday the 11th
Date.today
=> Sun, 11 Dec 2011
Date.tomorrow
=> Tue, 13 Dec 2011
@aaronlerch
aaronlerch / fluentmigrator_migration.xml
Created January 17, 2012 15:41
Simple Resharper live template for FluentMigrator migrations
<TemplatesExport family="Live Templates">
<Template uid="23818653-ac72-4057-9afc-35649cdfe0fc" shortcut="migration" description="FluentMigrator Migration" text="[Migration($VERSION$)]&#xD;&#xA;public class $MIGRATION_NAME$ : Migration&#xD;&#xA;{&#xD;&#xA; public override void Up()&#xD;&#xA; {&#xD;&#xA; $UP$&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; public override void Down()&#xD;&#xA; {&#xD;&#xA; $DOWN$&#xD;&#xA; }&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
<Context>
<CSharpContext context="Everywhere" minimumLanguageVersion="2.0" />
</Context>
<Categories />
<Variables>
<Variable name="VERSION" expression="getCurrentTime(&quot;yyyyMMddHHmmss&quot;)" initialRange="0" />
<Variable name="MIGRATION_NAME" expression="" initialRange="0" />
<Variable name="UP" expression="constant(&quot;throw new NotImplementedException();&quot;)" initialRange="0" />
@aaronlerch
aaronlerch / StringExtensions.cs
Created November 30, 2012 19:48
Ahhhh, much better.
public static class StringExtensions
{
public static bool Is(this string value, string compareTo)
{
return value.Is(compareTo, StringComparison.OrdinalIgnoreCase);
}
public static bool Is(this string value, string compareTo, StringComparison stringComparison)
{
return String.Equals(value, compareTo, stringComparison);