I hereby claim:
- I am bobbrez on github.
- I am bobbrez (https://keybase.io/bobbrez) on keybase.
- I have a public key whose fingerprint is 71AA E2C8 2FE0 DD07 9197 10BF 5658 1DDF C278 1BCC
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
require 'redis' | |
class Redis | |
REDIS_RPOPZADD = " | |
local value = redis.call('zrange', KEYS[1], -1, -1)[1] | |
local score = redis.call('zscore', KEYS[1], value) | |
redis.call('zremrangebyrank', KEYS[1], -1, -1) | |
redis.call('zadd', KEYS[2], score, value) | |
return { value, score }" | |
def rpopzadd(source, dest) |
SDP will add the ability to use queues with a scored priority using the SortedSet functionality in Redis. This will allow projects to add jobs to a dynamic queue with a numeric priority score. Jobs will then be processed from highest priority to the lowest. If a job is added with the highest priority, it will then be the next job to get pulled from the queue.
This will transparently augment the functionality in Sidekiq and will only provide additive functionality.
As an example, a dynamic priority queue exists with workers Alpha and Beta. At time(0)
the queue exists but workers have not pulled any jobs yet:
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
ActiveRecord::Schema.define(:version => 20110514135759) do | |
create_table "beers", :force => true do |t| | |
t.string "name" | |
t.string "brewery" | |
t.float "abv" | |
t.text "description" | |
t.string "image_url" | |
t.datetime "created_at" | |
t.datetime "updated_at" |
You'll need to change the permissions for /usr/local for your local user.
sudo chown -R
whoami /usr/local
The easiest way to get everything setup is to use Homebrew. To do this, you'll need to first install XCode from the standard XCode from Apple Developer site. Afterwards you can just install Homebrew though its normal installation
ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"
class Address < ActiveRecord::Base | |
belongs_to :contact | |
validates_presence_of :street, :town | |
end |
[user] | |
name = Bob Breznak | |
email = bob@where.com | |
[alias] | |
co = checkout | |
st = status | |
ci = commit | |
com = commit | |
di = diff |
So you have a document like this:
<!DOCTYPE html>
<html>
<head></head>
<body>
<textarea id="myText"></textarea>
</body>
</html>
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'terminal-table' | |
require 'json' | |
require 'hashie' | |
require 'csv' | |
data = Hashie::Mash.new JSON.parse(ARGF.read) | |
CSV.open('uvr.csv', 'w') do |csv| |