Skip to content

Instantly share code, notes, and snippets.

public class RepoConfiguration : Registry {
public RepoConfiguration() {
Scan(scan => {
scan.AssembliesFromApplicationBaseDirectory();
scan.AddAllTypesOf<IRepository>().NameBy(type => type.Name.Replace("Repository", string.Empty)); // register SqlServerRepository with name SqlServer
});
For<IRepository>().Use<SqlServerRepository>(); // define a default for no name calls
}
}
@ilude
ilude / jquery.ba-tinypubsub.js
Created April 27, 2011 03:28 — forked from rwaldron/jquery.ba-tinypubsub.js
jQuery Tiny Pub/Sub
/*!
* jQuery Tiny Pub/Sub - v0.X - 11/18/2010
* http://benalman.com/
*
* Original Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* Made awesome by Rick Waldron
*
@ilude
ilude / HashingTests.cs
Created October 21, 2011 00:56
Git Hash Tests
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using NUnit.Framework;
namespace GitHash.Tests
{
[TestFixture]
public class HashingTests
@ilude
ilude / hello_world.py
Created October 21, 2011 02:27
Sublime Text 2 - Open in Browser
import sublime, sublime_plugin
import webbrowser
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
url = self.view.file_name()
webbrowser.open_new(self.view.file_name())
@ilude
ilude / test-ssl-cipher.sh
Created March 2, 2012 18:10
Test https ssl ciphers
#!/bin/bash
# OpenSSL requires the port number.
SERVER=localhost:443
DELAY=1
echo -n Testing ssl2...
result=$(echo -n | openssl s_client -ssl2 -connect $SERVER 2>&1)
if [[ "$result" =~ "Cipher :" ]] ; then
echo supported. INSECURE!
@ilude
ilude / .gitconfig
Created April 27, 2012 15:05
Git Config
[branch]
autosetuprebase = always
[alias]
co = checkout
cb = checkout -b
ci = commit -m
s = status -s
br = branch
unstage = reset .
aa = !"git add -A . && git status -s"
@ilude
ilude / Guest download and install notes
Created May 3, 2012 12:11
Install VirtualBox Guest Additions
# Installing the virtualbox guest additions
VBOX_VERSION=$(cat /etc/vagabond/vbox_version)
cd /tmp
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
mount -o loop,ro VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run --nox11
umount /mnt
rm VBoxGuestAdditions_$VBOX_VERSION.iso
unset VBOX_VERSION
@ilude
ilude / chef-init.sh.erb
Created May 6, 2012 16:09
Chef Solo Configuration steps and files
mkdir -p ~/.ssh
cat > ~/.ssh/authorized_keys<<EOF
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAijGY3BBjONqbfTtgyPXS56Wb3w8+4BtMSvdf5L7gKI7FkeKSTNIBDkMfBT0yyslvwQZAuVVqiqV1elybUN45xgBj/Xrkzilg49WgRTRlo8wxjcZRbtMaoK0tAOHIFBBlxcAt/GAlvQOILOtLC0djEyJ2fbnFLUrZAdjqkFAz0RY/qsVU3MSA3PukcgzB/aj9VARD/dctoWSZW8C38IChRddMfayy7V0qLCUA9wZ5eZIRCE6LqTZyV3nDyPKl42H8O3DGoCEnfPaBdMema3QWcQ7dZ5UT8I4VO5dF0mvCN2dL81LeyqLlhvohM15YUPTfYXJudMHZNBq5SN2sLdjuTQ== mglenn@ilude.com
EOF
sudo -i
# Apt-install various things necessary for Ruby, guest additions,
# etc., and remove optional things to trim down the machine.
apt-get -y update
@ilude
ilude / gist:3343977
Created August 13, 2012 20:47
Gitolite Setup
sudo adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
su - git
cd ~
apt-get -y install git-core
git clone git://github.com/sitaramc/gitolite
gitolite/install -ln /usr/local/bin
# copy public key to ~/id_rsa.pub
cp ~/id_rsa.pub /home/git
@ilude
ilude / gist:3971718
Created October 29, 2012 05:21
VeeWee box creation commands
vagrant basebox templates
vagrant basebox define ubuntu-12.10 'ubuntu-12.10-server-amd64'
vagrant basebox build ubuntu-12.10
vagrant basebox validate ubuntu-12.10
vagrant basebox export ubuntu-12.10
vagrant box add ubuntu-12.10 ubuntu-12.10.box
vagrant init ubuntu-12.10