Skip to content

Instantly share code, notes, and snippets.

View MrJaba's full-sized avatar

Tom Crinson MrJaba

View GitHub Profile
module BoardsHelper
def render_board( board )
BoardPresenter.new( self, board ).render
end
def render_map( map )
MapPresenter.new( self, map ).render
end
#!/bin/bash
function rtest
{
ignore=${1:?'file not set'}
#locate test file name(s)
local test_file
local test_type
#are they unit / functionals?
#I hate this:
unless <condition> do
horrible_multiline block
more hideousness
end
#Even worse
unless <condition> do
horribleness
else
context "Context name" do
setup do
#init stuff here
end
should "test name/behaviour" do
get :blah, :param_1 => 'a', :param_2 => 'b'
puts @response.body
assert_select "blah"
end
end
//These are required node library files to assist us.
var sys = require('sys'),
http = require('http');
//http is the http library
//so on every request the given function will be called with a request and a response argument.
http.createServer(function (req, res) {
//write out the response headers
res.writeHead(200, {'Content-Type': 'text/html'});
//finish it up with what you want to send to the client
var sys = require('sys'),
http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
//Add a listener to the request for the request body data
var thing = null;
req.addListener('data', function(data){
thing = data.toString();
var sys = require('sys'),
http = require('http'),
require('./mustache'); //require with ./ as it's in local directory
//Set up a template to render HTML with {{title}} is a tag which gets replaced with content
//{{{content}}} is another tag which gets replaced. The triple moustache (curly brace) means don't escape HTML
var html_template = "<html><head><title>{{title}}</title></head><body>{{{content}}}</body></html>";
//Setup a basic form so we can post some data to the node server \'s are there to do multiline strings in Javascript
//Later on this can be hidden away in another file to make the code look prettier
var sys = require('sys'),
fs = require('fs'),
Url = require('url'),
http = require('http'),
querystring = require('querystring');
require('./mustache');
var html_template = "<html><head><title>{{title}}</title></head><body>{{{content}}}</body></html>";
var form = function() {return "<div id='container'> \
a = [1,2,3, "Cheddar", {:cheese => "awesome"}]
a.grep(String)
#=> ["Cheddar"]
a.grep(Hash)
#=> [{:cheese=>"awesome"}]
Issues Fixed:
#505,#507,#504,#506,#502,#503,#500,#501,#490,#499,#498,#496,#492,#495,#476,#478,#481,#479,#469,#461,#464,#455,#462,#462,#454,#460,#460,#459,#459,#455,#457,#458
Commits:
e6934f6 Fixed pack to taint output for tainted directives string.
b822da5 Specs for unpack output tainted if directive is tainted.
75bdbc5 Added configure option to specify 'rake' command. The value can be set via --rake option to the configure script
or by setting the RAKE environment variable.