This script is also available at .
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
An exception occurred running /Users/stan/.rvm/gems/rbx-1.0.0-rc5/bin/unicorn | |
directory for pid=/Users/stan/tmp/unicorn.pid not writable (ArgumentError) | |
Backtrace: | |
Unicorn::Configurator#reload {} at /Users/stan/.rvm/gems/rbx-1.0.0-rc5/gems/unicorn-0.99.0/lib/unicorn/configurator.rb:58 | |
Array#each at kernel/bootstrap/array.rb:158 | |
Unicorn::Configurator#reload at /Users/stan/.rvm/gems/rbx-1.0.0-rc5/gems/unicorn-0.99.0/lib/unicorn/configurator.rb:54 | |
Unicorn::Configurator#initialize at /Users/stan/.rvm/gems/rbx-1.0.0-rc5/gems/unicorn-0.99.0/lib/unicorn/configurator.rb:46 | |
Class#subclass_new (new) at kernel/alpha.rb:94 | |
#<Class:0x462>.new at kernel/common/struct.rb:69 |
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
StAnOfFiCe:api_frontend stan$ unicorn -c unicorn.conf.rb | |
dyld: lazy symbol binding failed: Symbol not found: _capi_get_constant | |
Referenced from: /Users/stan/.rvm/gems/rbx-1.0.0-rc5/gems/unicorn-0.99.0/lib/unicorn_http.bundle | |
Expected in: flat namespace | |
dyld: Symbol not found: _capi_get_constant | |
Referenced from: /Users/stan/.rvm/gems/rbx-1.0.0-rc5/gems/unicorn-0.99.0/lib/unicorn_http.bundle | |
Expected in: flat namespace | |
Trace/BPT trap |
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 BaseTask | |
def self.perform(*args) | |
ActiveRecord::Base.verify_active_connections! | |
end | |
end | |
class SomeTask < BaseTask | |
def self.perform(*args) | |
super | |
# do some stuff |
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 'rubygems' | |
require 'benchmark' | |
require 'bcrypt' | |
REPITITIONS = 50 | |
passwords = %w(password) | |
passwords.each do |password| | |
puts "Password to hash: #{password}" |
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
// once the google maps is loaded, put a Raphael canvas on top of it | |
// be sure to apply margin:0 to the body in this case | |
var point = new GLatLng(46.065375, 5.448974); | |
var pixel = map.fromLatLngToContainerPixel(point); | |
var paper = Raphael(0, 0, 400, 300); | |
var circle = paper.circle(pixel.x, pixel.y, 10); | |
circle.attr("fill", "#f00"); | |
circle.attr("stroke", "#fff"); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.swig505.redis</string> | |
<key>Program</key> | |
<string>/usr/local/redis/redis-server</string> | |
<key>ProgramArguments</key> | |
<array> |
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
# Recursively add a .gitignore file to all directories | |
# in the working directory which are empty and don't | |
# start with a dot. Helpful for tracking empty dirs | |
# in a git repository. | |
for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done; |
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
# Run rake db:size to get a print of your database size in bytes. | |
# Run rake db:tables:size to get the sizes for individual tables | |
# Works for MySQL and PostgreSQL. Not tested elsewhere. | |
namespace :db do | |
desc 'Print data size for entire database' | |
task :size => :environment do | |
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database] | |
adapter = ActiveRecord::Base.connection.adapter_name.downcase |
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
## solving Railscast #190 with "Scraper" | |
## http://github.com/mislav/scraper | |
## http://railscasts.com/episodes/190-screen-scraping-with-nokogiri | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'scraper' | |
class Walmart < Scraper |