Skip to content

Instantly share code, notes, and snippets.

View swgillespie's full-sized avatar

Sean Gillespie swgillespie

View GitHub Profile
@swgillespie
swgillespie / gist:6471013
Last active December 22, 2015 12:18
Sample ANT file
<project name="YourProjectName" default="build" basedir=".">
<description>
YOUR DESCRIPTION GOES HERE
</description>
<!-- Properties -->
<property name="src" location="src/"/>
<property name="bin" location="bin/"/>
<target name="init">
@swgillespie
swgillespie / gist:6742914
Created September 28, 2013 14:59
nodejs-starter makefile core dump
npm http GET https://registry.npmjs.org/passport-facebook
npm http GET https://registry.npmjs.org/jade
npm http GET https://registry.npmjs.org/passport-twitter
npm http GET https://registry.npmjs.org/mongoose
npm http GET https://registry.npmjs.org/connect-mongo
npm http GET https://registry.npmjs.org/component-builder
npm http GET https://registry.npmjs.org/string-to-js/0.0.1
npm http GET https://registry.npmjs.org/component-stylus-plugin
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/component
@swgillespie
swgillespie / gist:7049413
Last active December 25, 2015 22:28
Database Schema for CS4400
CREATE TABLE users (
username VARCHAR(20) NOT NULL PRIMARY KEY,
password CHAR(40) NOT NULL,
firstname VARCHAR(20) NOT NULL,
lastname VARCHAR(20) NOT NULL,
email VARCHAR(20) NOT NULL,
is_director CHAR(1) DEFAULT '0'
);
CREATE INDEX fullname ON users(firstname, lastname);
// Simple Binary Tree implementation in Rust.
// This snippet fails to compile with the given message:
//
// Compilation started at Sat Jan 11 22:31:53
// rustc --test binarytree.rs
// binarytree.rs:61:26: 61:32 error: mismatched types: expected `K` but found `K` (expected type parameter but found type parameter)
// binarytree.rs:61 if key < node_k {
// ^~~~~~
///
/// A LashToken is a token in Lash. Every token has an associated value.
///
use std::io;
use std::result;
pub enum LashToken {
Identifier(~str),
///
/// A LashToken is a token in Lash. Every token has an associated value.
///
use std::io;
use std::str;
#[deriving(Show, Eq, Clone)]
pub enum LashToken {
Identifier(~str),
///
/// A LashToken is a token in Lash. Every token has an associated value.
///
use std::io;
use std::str;
#[deriving(Show, Eq, Clone)]
pub enum LashToken {
Identifier(~str),
///
/// A LashToken is a token in Lash. Every token has an associated value.
///
use std::io;
use std::str;
#[deriving(Show, Eq, Clone)]
pub enum LashToken {
Identifier(~str),
use std::fmt;
#[deriving(Show, Clone)]
pub enum LinkedList<T> {
Node(T, ~LinkedList<T>),
Nil
}
impl<T: Clone> LinkedList<T> {
pub fn new() -> LinkedList<T> {
pub struct RopeNode<T> {
left: Option<~RopeNode<T>>,
right: Option<~RopeNode<T>>,
weight: uint,
balance_factor: int,
height: int,
data: Option<~[T]>
}
pub struct Rope<T> {