Skip to content

Instantly share code, notes, and snippets.

View andrewle's full-sized avatar

Andrew Le andrewle

View GitHub Profile
@andrewle
andrewle / projects.md
Created September 11, 2010 08:59
List of Current Projects

Productivity List

This is a list of things that I'm working on. All the projects that I want to spend more time doing that I work on depending on my mood the quality of time that I currently have.

Inspired by tips from Aaron Swartz at http://www.aaronsw.com/weblog/productivity

The Projects

define('START_TIME', microtime(true));
function benchmark($class, $function, $line)
{
error_log("dt => {$class}->{$function}:{$line} at: " . (microtime(true) - START_TIME) . " seconds.");
}
//Call by doing:
benchmark(__CLASS__, __FUNCTION__, __LINE__);
#!/usr/bin/env ruby
#
# This tag doesn't work: div.span-3col.column
#
full_line = STDIN.read
raw_tag = if full_line.strip.match(/\s/)
full_line.strip.reverse.match(/^.*?\s/).to_s.reverse.strip
else
full_line.strip.reverse.match(/^.*?\s?$/).to_s.reverse.strip
end
require 'rubygems'
require 'closure-compiler'
desc "Use the Closure Compiler to compress Tumbletag.js"
task :build do
js = File.open('tumbletag.js', 'r')
min = Closure::Compiler.new.compile(js)
File.open('tumbletag.min.js', 'w') {|f| f.write(min) }
end
@andrewle
andrewle / spacescroller.lua
Created April 13, 2010 03:40
Simple spaceship scroller game demo in Lua with the Love game engine
function love.load()
config = {
initial_x = 200,
initial_y = 400,
step = 500,
numStars = 100,
starSpeedFactor = 1
}
spaceship = {
#
# Implementation of Justin.TV's Namespace API for creating and playing application
# channels. In it's current form the application will dynamically allocate new
# Justin.TV channels for the sake of connecting two people together in a chat/date
# format.
# @author WinkVid
# @source http://sourceforge.net/projects/winkvid/
#
from django.views.generic.simple import direct_to_template
# For compiling PHP 5.2.11 on Mac OS X Leopard 10.5.8
#
# Configure PHP
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-dependency-tracking \
--with-apxs2=/usr/sbin/apxs \
# A rough and dirty baseline Rails app template
# I just discovered this feature and love it
remove_files = [
"public/index.html",
"public/images/rails.png",
"public/javascripts/controls.js",
"public/javascripts/dragdrop.js",
"public/javascripts/effects.js",
"public/javascripts/prototype.js"
#!/usr/bin/env bash
#
# Ignored .svn directories
# Also ignored .DS_Store files from Mac file system
# Add the --dry-run argument if you want to just test it first
DOMAIN="phototourwebsites@phototourwebsites.com"
DIR="/home/phototourwebsites/www/phototoursmls/idx_dev_andrew"
rsync -avz \
#!/usr/bin/env ruby
# Something to do for the gist command line script:
# Add a method that lists all your gists in the same way that git log does it