Skip to content

Instantly share code, notes, and snippets.

@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@gasman
gasman / pnginator.rb
Created April 30, 2012 18:08
pnginator: pack Javascript into a self-extracting PNG
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos
@agileguy
agileguy / mvcIntegrationTests.cs
Created April 17, 2012 06:55
MVC Integration Tests
using System.Web;
using System.Web.Mvc;
using MvcIntegrationTestFramework.Hosting;
using NUnit.Framework;
using website.Properties;
namespace website.tests
{
[TestFixture]
public class HomeControllerIndexTests
@alanstevens
alanstevens / lock_down_ubuntu.sh
Created February 21, 2012 16:28
Script to lock down a new Ubuntu server
#!/bin/sh
#
# execute this script as root with:
# curl https://raw.github.com/gist/1877257/lock_down_ubuntu.sh | bash -s MyAwesomeHostName
#
if [[ ! "root" = "$(whoami)" ]] ; then
echo -e "****\nThis script must be run as root.\n****" && exit 1
fi
@peterc
peterc / dnsd.rb
Created December 2, 2011 23:47
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
@msmith
msmith / couchdb-ec2-install.sh
Created August 25, 2011 17:26
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"
@mxriverlynn
mxriverlynn / Base64Dictionary.cs
Created February 4, 2011 16:40
Hiding sensitive information with base64 encoding and binary serialization
class Program
{
static void Main(string[] args)
{
var foo = new Base64Dictionary();
foo["bar"] = "baz";
foo["foo"] = "bar";
foo.WriteTo("test.bin");
@BenHall
BenHall / .gitignore
Created April 25, 2010 17:52
.gitignore
_ReSharper*
bin
obj
*.user
*.suo
*.cache