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
require 'autotest/redgreen' | |
# require 'autotest/pretty' | |
# require 'autotest/snarl' | |
# require 'autotest/timestamp' | |
module Autotest::Growl | |
def self.growl title, msg, img, pri=0, sticky="" | |
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}" | |
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
#!/usr/bin/env ruby | |
# Place this script in your shell's load path | |
require 'rubygems' | |
begin | |
require 'highline/import' | |
rescue | |
puts "'sudo gem install highline' in your system Ruby" | |
end | |
# Generate .rvmrc file in a project directory |
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
[api]: New apis / changes to apis | |
[test]: Update test/* files | |
[dist]: Changes to submodules, version bumps, updates to package.json | |
[minor]: Small changes | |
[doc]: Updates to documentation | |
[ux]: Updates to UX | |
[fix]: Bug fixes | |
[bin]: Update binary scripts associated with the project | |
[merge]: Resolved git merge from upstream or otherwise | |
[refactor]: Refactor of existing code with no external API changes |
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 postgis-1.5 path. | |
$ POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib/postgis-1.5 | |
# Creating the template spatial database | |
$ createdb -E UTF8 -T template0 template_postgis | |
# and add PLPGSQL language support. | |
$ createlang -d template_postgis plpgsql | |
# Loading the PostGIS SQL routines. | |
$ psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql |
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
# Array#join vs String#+ | |
require 'benchmark' | |
n = 1_000_000 | |
Benchmark.bm do |x| | |
x.report('Array#join :') { | |
n.times { ['this', 'is', 'a', 'test'].join(' ') } | |
} | |
x.report('String#+ :') { |
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 http = require('http'), | |
userAgent = require('useragent'); | |
http.createServer(function (request, response) { | |
var userAgentString = request.headers['user-agent'], | |
ua_obj = userAgent.parse(userAgentString), | |
is = userAgent.is(userAgentString), | |
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
12345678901234567890123456789012345678901234567890123456789012345678901234567890 | |
00000000001111111111222222222233333333334444444444555555555566666666667777777777 |
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
# 1.8.7 | |
[1, 2, 3].to_s | |
# => "123" | |
# 1.9.3p194 | |
[1, 2, 3].to_s | |
# => "[1, 2, 3]" # WAT? | |
# `Array#to_s` is an alias to `Array#inspect` |
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
-- Works with CQL SPEC 3.0.0 and Cassandra 1.1.1 | |
-- Usage: cqlsh -3 < counter.cql | |
CREATE TABLE counters ( | |
counter_name varchar, | |
value counter, | |
PRIMARY KEY (counter_name) | |
) | |
WITH comment='Aggregate counters'; |
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
(ns memoize-vs-deref.core | |
(:use criterium.core)) | |
(def test-vec | |
[{ :a 1 } | |
{ :f 6 } | |
{ :c 3 } | |
{ :d 4 } | |
{ :g 7 } | |
{ :h 8 } |
OlderNewer