Skip to content

Instantly share code, notes, and snippets.

# To test this out, call:
# (206) 357-6220 x33684 or
# sip:2063576220@vox4.cloudvox.com x33684
default {
if calleridname != 'Not available'
name = calleridname
end
text = "Hello #{name}, I think you're calling from #{callerid}"
{"$id":"1","Error":"This salt has already been used in the last 8 hour period"}
Manifest-Version: 1.0
Implementation-Vendor: net.lag
Implementation-Title: kestrel
Implementation-Version: 2.4.1
Implementation-Vendor-Id: net.lag
Class-Path: libs/scala-library.jar libs/ostrich-8.2.9.jar libs/scala-j
son-3.0.1.jar libs/util-core-5.3.13.jar libs/util-eval-5.3.13.jar lib
s/scala-compiler.jar libs/util-logging-5.3.13.jar libs/util-jvm-5.3.1
3.jar libs/naggati_2.9.2-4.1.0.jar libs/finagle-core-5.3.19.jar libs/
netty-3.5.5.Final.jar libs/util-collection-5.3.13.jar libs/jsr305-1.3
package main
import (
"testing"
"sync"
"sync/atomic"
)
func TestOneBarrier(t *testing.T) {
expected := int32(2)
# From Edge Rails
class Object
unless public_method_defined?(:present?)
def present?
!blank?
end
end
end
# Parallel map
# Originally from http://project.ioni.st/post/2332#snippet_2332
class Array
def pmap
threads = []
0.upto(size - 1) do |n|
threads << Thread.new do
yield(at(n))
end
end
@eric
eric / twitter_word_count.rb
Created August 8, 2008 21:49
Making it simple to provide input for http://wordle.net/create
#
# Created by Eric Lindvall <eric@5stops.com>
#
# Making it simple to provide input for http://wordle.net/create
#
#
require 'rubygems'
gem 'mechanize'
require 'mechanize'
require 'open-uri'
require 'hpricot'
class Gistr
def initialize(gist_id)
@gist_id = gist_id
end
def post(email, password, title)
post_to_tumblr(email, password, title, gist_code)
class CreditCardType < ActiveRecord::Base
acts_as_enumeration :lookup_name
column :name
def initialize(attributes = nil)
super
self.lookup_name ||= name.to_s.gsub(/[^A-Za-z0-9-]/, '').underscore
end
create :id => 1, :name => 'Visa'