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
#I hate this: | |
unless <condition> do | |
horrible_multiline block | |
more hideousness | |
end | |
#Even worse | |
unless <condition> do | |
horribleness | |
else |
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
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 |
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
//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 |
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 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(); |
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 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 |
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 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'> \ |
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
a = [1,2,3, "Cheddar", {:cheese => "awesome"}] | |
a.grep(String) | |
#=> ["Cheddar"] | |
a.grep(Hash) | |
#=> [{:cheese=>"awesome"}] |
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
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. |
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
RuntimeError: Unknown media type: ".ttf" | |
/Library/Ruby/Gems/1.8/gems/sinatra-1.1.0/lib/sinatra/base.rb:133:in `content_type' | |
/Library/Ruby/Gems/1.8/gems/padrino-core-0.9.19/lib/padrino-core/application/routing.rb:578:in `content_type' | |
/Library/Ruby/Gems/1.8/gems/padrino-core-0.9.19/lib/padrino-core/application/rendering.rb:88:in `content_type' | |
/Library/Ruby/Gems/1.8/gems/sinatra-1.1.0/lib/sinatra/base.rb:156:in `send_file' | |
/Library/Ruby/Gems/1.8/gems/padrino-core-0.9.19/lib/padrino-core/application/routing.rb:560:in `static!' |
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
Rack::Mime::MIME_TYPES.merge!(".ttf"=>"application/octet-stream", ".woff" =>"application/octet-stream") |