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
if (realpath(__FILE__) == realpath($_SERVER["SCRIPT_FILENAME"])) { exit; } | |
function Scenario($msg=NULL) { | |
echo "<style>.bad { color: red; } .good { color: green; } .when { border: solid thin black; color: black; width: 75%; position: relative; margin-left: auto; margin-right: auto; margin-top: 2em;}</style>"; | |
echo "<h1>Scenario: ".(is_null($msg) ? basename(__FILE__) : htmlspecialchars($msg))."</h1>"; | |
} | |
function When($msg) { | |
echo "<fieldset class='when'><legend>When: ".htmlspecialchars($msg)."</legend>"; | |
} | |
function Then( $content ) { |
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
set nocompatible | |
set backupdir=~/tmp " keep vim's temp files out of your repos | |
" Use pathogen to easily modify the runtime path to include all plugins under | |
" the ~/.vim/bundle directory | |
filetype off " force reloading *after* pathogen loaded | |
call pathogen#helptags() | |
call pathogen#runtime_append_all_bundles() | |
filetype plugin indent on " enable detection, plugins and indenting in one step |
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
rvm use ruby-1.8.7-p302@sinatra |
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
#!/usr/bin/env ruby | |
# See http://api.wunderground.com/weather/api/d/documentation.html | |
require 'open-uri' | |
require 'json' | |
zip=ARGV[0]||27571 | |
apikey=YOURWUGAPIKEYHERE | |
open("http://api.wunderground.com/api/#{apikey}/conditions/forecast/q/#{zip}.json") do |f| | |
json_string = f.read |
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
$ rails c | |
nLoading development environment (Rails 3.2.1) | |
1.9.3p0 :001 > nil | |
=> nil | |
1.9.3p0 :002 > nil.nil? | |
=> true | |
1.9.3p0 :004 > nil.each |
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 | |
/** | |
* @package One-off mySQL Query in PHP via mysqli | |
* @description Express a query as an object in PHP | |
* @version 1.0 | |
* @copyright Copyright 2010 by Mitchell Amiano All Rights Reserved. | |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL | |
* */ |
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 | |
/** | |
* @package One-time pad signal script | |
* @description Feedback signal via HTTP GET or POST using a one-time pad communicated through a separate process, as an alternative to the convoluted Joomla! 1.5.x XMLRPC feature. | |
* @version 1.0 | |
* @copyright Copyright 2010 by Mitchell Amiano All Rights Reserved. | |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL | |
* */ | |
// place this script in a non-Web accessible location, then require it from a wrapper script |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>jQuery Contrast Checking Plugin</title> | |
<style type="text/css"> | |
article, aside, figure, footer, header, hgroup, | |
menu, nav, section { display: block; } | |
</style> |
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
/* this is a lot of probably unnecessary crap brought in from Compass. | |
*/ | |
@import url(http://fonts.googleapis.com/css?family=Nixie+One:400); | |
@import url(http://fonts.googleapis.com/css?family=Cabin:500); | |
/* line 17, ../../../.rvm/gems/ruby-1.9.2-p0@global/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
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
// note: no error checking is performed at all | |
// note: no entity substitution (< and & in particular) is performed | |
// format an element start tag with optional attributes | |
// gi is assumed to be a generic identifier | |
// attlist is assumed to be an associative array indexed by attribute name | |
// eg { myprop1: "val1", myprop2: "val2" } | |
var formatStag = function(gi, attlist) | |
{ | |
var data = "<" + gi ; |