Skip to content

Instantly share code, notes, and snippets.

View al-the-x's full-sized avatar

David Rogers AKA "AL the X" al-the-x

View GitHub Profile
class MoneyParser
ONE_TO_TEN = {
"one" => 1,
"two" => 2,
"nine" => 9,
"five" => 5,
"four" =>4,
"seven" => 7,
"eight" => 8,
require 'test/unit'
require 'money_parser'
class MoneyParserTest < Test::Unit::TestCase
def assert_string_parses ( string, expected )
money_result = MoneyParser.parse(string)
assert_equal expected, money_result,
"Expected '#{string}' to return #{expected}!"
@al-the-x
al-the-x / main.php
Created May 8, 2011 03:15
OrlandoPHP Coding Dojo -- May 5, 2011
<?php
class Key {
private isValid = false;
}
class Car
{
protected $door_opened = false;
public function open_door() {
@al-the-x
al-the-x / main.py
Created May 8, 2011 03:34
OrlandoDojo -- May 7, 2011
class Car ( object ):
is_locked = True
capacity = 4
occupancy = 0
engineIsOn = False
def unlock(self):
self.is_locked = False
return self
@al-the-x
al-the-x / .tmuxrc
Created May 10, 2011 20:11 — forked from xentek/.tmux.conf
custom .tmux.conf (renamed to .tmuxrc) file for your multiplexing pleasure
###
# Custom tmux configuration cobbled together from google and trial & error
# by Eric Marden (xentek.net), heavily modified by David Rogers (@al-the-x).
##
# set the command prefix to match gnuscreen (i.e. CTRL+a)
set-option -g prefix C-a
# use the NEW prefix key to "send-prefix" instead of the default
unbind-key C-b; bind-key C-a send-prefix
@al-the-x
al-the-x / main.js
Created May 21, 2011 16:32
Coding Dojo -- May 21, 2011
var Server = function()
{
var clients = [ ];
this.sendMessage = function()
{
return true;
}
this.receiveMessage = function()
@al-the-x
al-the-x / Zend_Search_Lucene_MultiSearcher.php.patch
Created June 9, 2011 17:42
Zend_Search_Lucene_MultiSearcher is incorrectly named...
diff --git Zend/Search/Lucene/MultiSearcher.php Zend/Search/Lucene/MultiSearcher.php
index b2cb033..021b422 100644
--- Zend/Search/Lucene/MultiSearcher.php
+++ Zend/Search/Lucene/MultiSearcher.php
@@ -31,7 +31,7 @@ require_once 'Zend/Search/Lucene/Interface.php';
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
-class Zend_Search_Lucene_Interface_MultiSearcher implements Zend_Search_Lucene_Interface
+class Zend_Search_Lucene_MultiSearcher implements Zend_Search_Lucene_Interface
@al-the-x
al-the-x / main.php
Created July 5, 2011 21:39
OrlandoPHP Coding Dojo -- Jun 18, 2011
<?php
/**
* 0 = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 . . . ];
* 1 = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 . . . ];
* 2 = [ 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 . . . ];
* 3 = [ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0 . . . ];
* 4 = [ 1, 0, 0, 1, 1, 1, 1, 1, 0, 0 . . . ];
* 5 = [ . . . ];
* . . .
* 100 = [ ??? ];
@al-the-x
al-the-x / main.js
Created July 16, 2011 17:06
Coding Dojo -- July 16, 2011
Hallway = function(){
/*
var private_property = null;
this.public_property = null;
this.public_method = function(){
private_method();
};
@al-the-x
al-the-x / jquery.plugin.js
Created July 25, 2011 03:53
jQuery Plugin Template
// See the last line for why "$" is important here...
(function($){ // closure
/**
* jsDocs go here...
*/
$.fn.plugin = function( options ){
/**
* @var jQuery collection passed to the plugin
*/
var collection = this;