This file contains hidden or 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
# Prototype spider which uses 'bbc_standards' to test a whole website | |
require 'rubygems' | |
require 'anemone' | |
require 'bbc_standards' | |
require 'term/ansicolor' | |
class String | |
include Term::ANSIColor | |
end |
This file contains hidden or 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
{ | |
"description" : "A schema describing API docs. Top-level object is the top level anonymous namespace", | |
"extends" : [ { "$ref" : "#.defs.namespace" } ], | |
"properties" : { | |
"typedefs" : { | |
"type" : "object", | |
"optional" : true, | |
"additionalProperties" : { "$ref" : "#.defs.typedef" } | |
} | |
}, |
This file contains hidden or 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/node | |
var fs = require('fs'); | |
var sys = require('sys'); | |
var schema = fs.readFileSync(process.argv[2], 'utf8'); | |
var json = fs.readFileSync(process.argv[3], 'utf8'); | |
schema = JSON.parse(schema); |
This file contains hidden or 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
{ | |
"namespaces" : { | |
"glow" : { | |
"namespaces" : { | |
"dom" : { | |
"classes" : { | |
"NodeList" : { | |
"constructor" : { | |
"methods" : { | |
"aStaticMethod" : { |
This file contains hidden or 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 pb = new PhoneBook('asdf.txt'); | |
pb.on('error', function(error) { | |
console.log(error); | |
}); | |
pb.on('data', function(data) { | |
console.log(data); | |
}); |
This file contains hidden or 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
search and replace | |
------------------- | |
s/foo/bar/g changes each 'foo' to 'bar' in the current line. | |
:%s/foo/bar/g changes each 'foo' to 'bar' in all lines. | |
:5,12s/foo/bar/g changes each 'foo' to 'bar' for all lines between line 5 and line 12. | |
:'a,'bs/foo/bar/g changes each 'foo' to 'bar' for all lines between marks a and b. | |
:.,$s/foo/bar/g changes each 'foo' to 'bar' for all lines between the current line (.) and the last line ($). | |
:.,+2s/foo/bar/g changes each 'foo' to 'bar' for the current line (.) and the two next lines (+2). | |
:%s is equivalent to :1,$s |
This file contains hidden or 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
source "http://rubygems.org" | |
gem "cucumber" | |
gem "capybara" | |
gem "capybara-webkit", :platforms => [:ruby], :require => false, :git => "git://github.com/thoughtbot/capybara-webkit.git" | |
gem "capybara-mechanize", :git => "git://github.com/jeroenvandijk/capybara-mechanize.git" | |
gem "rspec" | |
gem "rake" | |
This file contains hidden or 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
=begin | |
Environment variables you can set: | |
MHT_HOST=domain.com ... the host to test, default is www.mangahigh.com | |
MHT_DRIVER='mechanize' ... default capybara driver to use, valid values are: | |
mechanize, | |
celerity, | |
chrome, | |
culerity, | |
selenium, |
This file contains hidden or 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
/** | |
* Create a fake console api, mimicing Firebug. | |
*/ | |
(function(global) { | |
var noop = function(){}; | |
if ( !global['console'] ) { | |
global.console = { | |
log : noop, | |
debug : noop, |
This file contains hidden or 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
jQuery.fn.appendAt = function( content, index ) { | |
this.each(function(i, item) { | |
var $content = $(content).clone(); | |
if ( index === 0 ) { | |
$(item).prepend($content); | |
} else { | |
$content.insertAfter($(item).children().eq(index-1)); | |
} | |
}); |
OlderNewer