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
class DeliciousToken < ConsumerToken | |
DELICIOUS_SETTINGS = { | |
:site => 'https://api.login.yahoo.com', | |
:http_method => :get, | |
:scheme => :query_string, | |
:request_token_path => '/oauth/v2/get_request_token', | |
:access_token_path => '/oauth/v2/get_token', | |
:authorize_path => '/oauth/v2/request_auth', | |
} |
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 | |
require 'benchmark' | |
require 'json' | |
require 'bson' | |
T = 100_000 | |
[{ :foo => 2 }, { :foo => 2, :bar => 3, :baz => "long very very long and big and uncut string" }, | |
{ :foo => 2, :bar => 3, :baz => "long very very long and big and uncut 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
psql -U postgres | |
create database template_postgis with template = template1; | |
UPDATE pg_database SET datistemplate = TRUE where datname = 'template_postgis'; | |
\c template_postgis | |
CREATE LANGUAGE plpgsql; | |
# arch | |
\i /usr/share/postgresql/contrib/postgis-1.5/postgis.sql | |
\i /usr/share/postgresql/contrib/postgis-1.5/spatial_ref_sys.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
DEVICE = atmega32 #90s2313 | |
AVRDUDE = avrdude -c usbasp -p $(DEVICE) | |
# Choose your favorite programmer and interface above. | |
COMPILE = avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=$(DEVICE) #-DDEBUG_LEVEL=2 | |
# NEVER compile the final product with debugging! Any debug output will | |
# distort timing so that the specs can't be met. | |
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o |
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
;; Fxx Colour Theme for Emacs. | |
;; | |
;; Defines a colour scheme resembling that of the original TextMate Fxx colour theme. | |
;; To use add the following to your .emacs file (requires the color-theme package): | |
;; | |
;; http://wiki.nofxx.com/_detail/x:xxx2tmscreen.png | |
;; | |
;; (require 'color-theme) | |
;; (color-theme-initialize) | |
;; (load-file "~/.emacs.d/fxx-emacs/color-theme-fxx.el") |
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 'pry' | |
require 'spork' | |
# Loading more in this block will cause your tests to run faster. | |
# if you change any configuration or code from libraries loaded | |
# need to restart spork for it take effect. | |
Spork.prefork do | |
ENV["RAILS_ENV"] ||= 'test' | |
require 'rails/application' |
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 'spork' | |
Spork.prefork do | |
ENV['RAILS_ENV'] ||= 'test' | |
require 'rails/application' | |
Spork.trap_method(Rails::Application::RoutesReloader, :reload!) | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'database_cleaner' |
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 'mongoid' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db("foo_#{Time.now.to_i}") | |
end | |
class Project | |
include Mongoid::Document | |
field :name | |
field :state, :default => 'active' |
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
main() | |
int x = 1; | |
float y = 22.5; | |
char c = 'C'; | |
char[] = "Take this " + c + "!"; | |
printf("x to i: %d\n", x); |
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
(type.ps) runlibfile | |
(unit.ps) runlibfile | |
(IsoLatin.enc) runlibfile | |
/default_encoding IsoLatin def | |
<< /Duplex false /Tumble false >> setpagedevice | |
/pagesize [595 842] def | |
/margin 3 dict def margin begin /top 1 cm def /right 1 cm def /bottom 1 cm def /left 1 cm def end | |
(paper.ps) runlibfile | |
[ /Producer (Ruby Ghostscript - RGhost v0.8.7) /DOCINFO pdfmark /rows_per_page 80 def /count_pages 10 def /row_height 0.4 cm def /row_padding 0.1 cm def (basic.ps) runlibfile | |
(cursor.ps) runlibfile |