Skip to content

Instantly share code, notes, and snippets.

Running exactly two test files

With just ruby:

$ ruby -Ilib:test -e'require "test1"; require "test2"'

Via your rake task:

$ rake TEST=test/test[1,2].rb
@madrobby
madrobby / LICENSE.txt
Created August 1, 2011 21:34 — forked from 140bytes/LICENSE.txt
lettering.js
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Thomas Fuchs <http://mir.aculo.us/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@p01
p01 / LICENSE.txt
Created July 30, 2011 11:27 — forked from 140bytes/LICENSE.txt
isPrimeNumber in 41 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri <http://www.p01.org/releases/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / LICENSE.txt
Created July 17, 2011 07:37 — forked from 140bytes/LICENSE.txt
JSON stringify
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@nesk
nesk / LICENSE.txt
Created June 17, 2011 13:31 — forked from 140bytes/LICENSE.txt
Detect CSS 3 transitions support
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Johann PARDANAUD : http://plune.fr
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@necolas
necolas / snippet.js
Created June 14, 2011 20:36
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@cowboy
cowboy / ba-ghettotmpl.js
Created June 11, 2011 04:31
Ghetto fabulous templating system. More ghetto than fabulous.
// Ghetto fabulous template system for replacing values in strings. If {{.foo}}
// or {{.bar[0].baz}} is encountered (leading . or ( or [ char), attempt to
// access properties of data object like `data.foo` or `data.bar[0].baz`.
// Alternately, if {{foo}} or {{bar("baz")}} is encountered (no leading dot),
// simply evaluate `foo` or `bar("baz")`. If an error occurs, return empty
// string. Oh yeah, you have to pass the result of ghettoTmpl to eval. :)
var ghettoTmpl = function(data, str) {
if ( typeof data === "string" ) {
str = data;
@DmitrySoshnikov
DmitrySoshnikov / es5-negative-indicies.js
Created May 21, 2011 21:32
Manual negative indicies of arrays in ES5
/**
* Manual negative indicies for arrays in ES5:
* usually we use in such cases only first three
* negative indices, so these are enough (you may
* add -4, -5, etc. if needed).
*
* See also the implementation with proxies:
* https://github.com/DmitrySoshnikov/es-laboratory/blob/master/src/array-negative-indices.js
*
* by Dmitry Soshnikov <[email protected]>
@madrobby
madrobby / LICENSE.txt
Created May 19, 2011 14:46 — forked from 140bytes/LICENSE.txt
Mock objects
Copyright (c) 2011 Thomas Fuchs, http://mir.aculo.us/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
function escapeHTML(s,r){r='replace';return s[r](/&/g,'&amp;')[r](/>/g,'&gt;')[r](/</g,'&lt;')}