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
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Demo</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script src="http://raphaeljs.com/raphael.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript" charset="utf-8"> |
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 V = { | |
init: function(x, y, z) { | |
return { x: x, y: y, z: z }; | |
}, | |
add: function(v1, v2) { | |
return { | |
x: v1.x + v2.x, | |
y: v1.y + v2.y, | |
z: v1.z + v2.z |
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
require 'benchmark' | |
require 'rubygems' | |
require 'active_support/all' | |
@config = [] | |
10.times do |x| | |
options = {} | |
10.times { |y| options["key#{y}"] = "value#{y}" } | |
@config << ["name#{x}", options] | |
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
require 'beaneater' | |
require 'json' | |
@beanstalk = Beaneater::Pool.new(['localhost:11300']) | |
total = 0 | |
puts "Listening for jobs..." | |
@beanstalk.jobs.register('test-tube') do |job| | |
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
payments = crossfilter([ | |
{ date: "2011-11-14T16:17:54Z", total: 190, tip: 100, type: "tab" }, | |
{ date: "2011-11-14T16:20:19Z", total: 190, tip: 100, type: "tab" }, | |
{ date: "2011-11-14T16:28:54Z", total: 300, tip: 200, type: "visa" }, | |
{ date: "2011-11-14T16:30:43Z", total: 90, tip: 0, type: "tab" }, | |
{ date: "2011-11-14T16:48:46Z", total: 90, tip: 0, type: "tab" }, | |
{ date: "2011-11-14T16:53:41Z", total: 90, tip: 0, type: "tab" }, | |
{ date: "2011-11-14T16:54:06Z", total: 100, tip: 0, type: "cash" }, | |
{ date: "2011-11-14T16:58:03Z", total: 90, tip: 0, type: "tab" }, | |
{ date: "2011-11-14T17:07:21Z", total: 90, tip: 10, type: "tab" }, |
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
db.dummies.aggregate([ | |
{ | |
$group: { | |
_id: { num: "$num" }, | |
records: { $push: "$$ROOT" } | |
} | |
}, | |
{ | |
$project: { | |
_id: 0, |
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
$ irb -r ./up_serializer.rb | |
irb(main):001:0> YAML.load YAML::UpSerializer.new('1.9.3-p484').up_serialize "---\nkey: ,oh,dear\n" | |
=> {"key"=>",oh,dear"} | |
irb(main):002:0> |
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
border: no | |
height: 1000 |
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
#!/bin/sh | |
git checkout trunk | |
ruby benchmark.rb > benchmark-trunk.log | |
ruby allocations.rb > allocations-trunk.log | |
git checkout csv_allocation_reduction | |
ruby benchmark.rb > benchmark-patch.log | |
ruby allocations.rb > allocations-patch.log |
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/env ruby | |
@revision = ENV.fetch('REVISION') | |
@message = ENV.fetch('COMMIT_MESSAGE') | |
@user = ENV.fetch('SVN_USERNAME') | |
@api_key = ENV.fetch('REDMINE_API_KEY') | |
require 'json' | |
require 'net/http' |
OlderNewer