Skip to content

Instantly share code, notes, and snippets.

View ianpreston's full-sized avatar

Ian Preston ianpreston

View GitHub Profile
@ianpreston
ianpreston / gist:5629463
Created May 22, 2013 17:48
Pyramid Sort
using System.IO;
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main()
{
int[] elements = { 1, 8, 9, 13, 2, 7 };
@ianpreston
ianpreston / fabfile.py
Created December 10, 2012 04:57
Tiny, fabric-based static site generator
from fabric.api import local
import jinja2
import sys
import os
import os.path
import webbrowser
proj_base_path = sys.path[0]
pages_path = os.path.join(proj_base_path, 'pages')
build_path = os.path.join(proj_base_path, 'build')
var sys = require("sys"),
http = require("http"),
querystring = require("querystring"),
htmlparser = require("htmlparser"),
soupselect = require("soupselect"),
irc = require("irc");
/**
* Wrapper for making an HTTP request, reading the data, instantiating a htmlparser.Parser
* and parsing the page. htmlparserHandlerFunction will be passed to htmlparser.DefualtHandler.