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 'ramaze' | |
max = 40 | |
final = [] | |
Dir.glob("#{Ramaze::ROOT}/**/*.rb") do |path| | |
blocks = [] | |
File.open path do |file| | |
block = [] |
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
class Binding | |
def self.of_caller | |
bt = Rubinius::VM.backtrace(2, true).first | |
Binding.setup( | |
bt.variables, | |
bt.variables.method, | |
bt.static_scope | |
) | |
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 'makura' | |
require 'rye' | |
root = Makura::Server.new('http://host:5984') | |
nodes = root.membership['cluster_nodes'] | |
p nodes: nodes | |
nodes.each do |node| | |
node_name = node[/@(\w+)/, 1] | |
puts "Connecting to #{node_name}" |
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
http = require 'http' | |
p = console.log | |
options = { | |
host: 'kyle', | |
port: 5984, | |
path: '/tiny_cdr/_all_docs?include_docs=true&limit=100' | |
} | |
map_results = [] |
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
originalDTMF = { | |
0: 0, | |
1: 1, 2: 2, 3: 3, | |
4: 4, 5: 5, 6: 6, | |
7: 7, 8: 8, 9: 9, | |
a: 2, b: 2, c: 2, | |
d: 3, e: 3, f: 3, | |
g: 4, h: 4, i: 4, | |
j: 5, k: 5, l: 5, |
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
import math | |
import vector | |
import sdl | |
type | |
OBall = object | |
vector: TVector2 | |
velocity: TVector2 | |
radius: float | |
speed: float |
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
# Contributor: Stephen Diehl <sdiehl at clarku dot edu> | |
pkgname=coffee-script-git | |
pkgver=20110210 | |
pkgrel=1 | |
pkgdesc='CoffeeScript is a little language that compiles into JavaScript.' | |
arch=any | |
url=http://coffeescript.org | |
license=(custom) | |
makedepends=(nodejs) | |
md5sums=() |
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
module Pluralize | |
module_function | |
def pluralize(string) | |
string = string.dup | |
@plural.each do |pattern, options| | |
string.gsub!(pattern, options[:replace]) | |
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 'ramaze' | |
class Main < Ramaze::Controller | |
def index | |
make_static | |
end | |
private | |
def make_static |
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
(use posix format) | |
(setenv "TZ" "UTC-1") | |
(let ((tl (seconds->local-time (current-seconds)))) | |
(format #t "@~,2F~%" (+ (* (vector-ref tl 2) (/ 1000 24)) | |
(* (vector-ref tl 1) (/ 1000 24 60)) | |
(* (vector-ref tl 0) (/ 1000 24 60 60))))) |