This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MoneyParser | |
ONE_TO_TEN = { | |
"one" => 1, | |
"two" => 2, | |
"nine" => 9, | |
"five" => 5, | |
"four" =>4, | |
"seven" => 7, | |
"eight" => 8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Key { | |
private isValid = false; | |
} | |
class Car | |
{ | |
protected $door_opened = false; | |
public function open_door() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car ( object ): | |
is_locked = True | |
capacity = 4 | |
occupancy = 0 | |
engineIsOn = False | |
def unlock(self): | |
self.is_locked = False | |
return self | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Server = function() | |
{ | |
var clients = [ ]; | |
this.sendMessage = function() | |
{ | |
return true; | |
} | |
this.receiveMessage = function() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 = [ ??? ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hallway = function(){ | |
/* | |
var private_property = null; | |
this.public_property = null; | |
this.public_method = function(){ | |
private_method(); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
OlderNewer