Skip to content

Instantly share code, notes, and snippets.

@mislav
mislav / .rspactor
Created March 17, 2009 13:12
RSpec colorized unicode output with Rspactor integration
# this goes in the $HOME dir
# needs mislav-rspactor v0.3.2 and RSpec 1.2
RSpactor::Runner.class_eval do
alias old_formatter_opts formatter_opts
def formatter_opts
# update this path to where you saved unicode_formatter.rb
old_formatter_opts + " -r /Users/mislav/Projects/unicode_formatter -f UnicodeFormatter"
end
end
class BlackHoleStore
def logger
Rails.logger
end
def fetch( *args )
yield
end
def read( *args )
# Hi! I'am rack middleware!
# I was born for return to you valid js on json i18n objects
# My author's name was Aleksandr Koss. Mail him at kossnocorp@gmail.com
# Nice to MIT you!
class I18nJs
def initialize app, options = {}
@app = app
@options = options
gemcutter => redis downloads spec
=================================
keys
----
downloads => global counter for all gem downloads
downloads:today => sorted set for downloads from today
downloads:rubygem:rails => counter for all rails downloads
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads
@mislav
mislav / Gemfile.rb
Created February 22, 2010 20:54
Bundler setup for Rails 2.3.x apps
## example Gemfile
source :rubygems
group :rails do
gem 'rake', '< 0.9', :require => nil
gem 'rails', '~> 2.3.5', :require => nil
gem 'builder', '~> 2.1.2'
gem 'memcache-client', '>= 1.7.4', :require => nil
gem 'tzinfo', '~> 0.3.12'
gem 'i18n', '>= 0.1.3'
@rafaelss
rafaelss / Gemfile
Created May 20, 2010 22:18 — forked from rmanalan/.gems
rack static site
source "http://rubygems.org"
gem 'rack-contrib', :git => 'git://github.com/rack/rack-contrib.git'
gem 'rack-rewrite'
#!/bin/bash
SNAPID="SNAP"
BACKUPDBID="TEMPDB"
#config groups
SECURITYGROUP="Mysecgrup"
PARAMSGROUP="Myparamsgrup"
#rds verifying commands
#
# Cookbook Name:: nodejs
# Recipe:: default
#
if ['solo'].include?(node[:instance_role])
nodejs_file = "node-v0.1.101.tar.gz"
nodejs_dir = "node-v0.1.101"
nodejs_url = "http://nodejs.org/dist/#{nodejs_file}"
# usage:
# $ superblame Mislav <from>..<to>
function superblame {
git log --format=%h --author=$1 $2 | \
xargs -L1 -ISHA git diff --shortstat 'SHA^..SHA' app config/environment* config/initializers/ public/stylesheets/ | \
ruby -e 'n=Hash.new(0); while gets; i=0; puts $_.gsub(/\d+/){ n[i+=1] += $&.to_i }; end' | tail -n1
}
@jruz
jruz / .zshrc
Last active September 18, 2015 11:31 — forked from Morantron/eslint
Use local eslint if available if not use global
eslint () {
if [[ -f ./node_modules/.bin/eslint ]]; then
./node_modules/.bin/eslint $*
else
"${$(nvm which default)%node}eslint" $*
fi
}