curl https://gist.github.com/raw/970438/caff9a09ed2d223b1123a69ede17cb19ad352af9/build.sh | sh
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
irb(main):016:0> ThinkingSphinx.search 'test', :classes => [Article, BlogPost] | |
Sphinx Querying: 'test' | |
Sphinx (0.004608s) Found 20 results | |
Article Load (0.5ms) SELECT `emp_articles`.* FROM `emp_articles` WHERE (`emp_articles`.`id` IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) | |
(Object doesn't support #inspect) | |
=> | |
irb(main):017:0> |
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
## Rails App Template | |
## Updated for Rails 3.0.7 | |
## Created on 10/23/10 | |
## Updated on 5/7/11 | |
## Run using $ rails new [appname] -JT -m tpl-cukeapp.rb | |
## Gems | |
# Warden and Devise for security | |
gem 'warden', '1.0.4' |
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 'rubygems' | |
require 'backports' # aliases Proc#=== to Proc#call | |
rs = (0..10000).to_a.sample(30) | |
rs.each do |r| | |
case r | |
when lambda { |n| n.zero? } then puts "#{r} is zero" | |
when lambda { |n| (n % 5).zero? } then puts "#{r} is fiven" | |
when lambda { |n| (n % 4).zero? } then puts "#{r} is fourven" |
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
FactoryGirl.define do | |
sequence :email do |n| | |
"user#{n}@example.com" | |
end | |
factory :user do | |
password "test" | |
aliased_as :author | |
end |
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
# | |
# lib/mongoid/counter_cache.rb | |
# ruby | |
# | |
# Created by Zhang Alex on 2011-06-17. | |
# Copyright 2011 __ZhangHanDong__. All rights reserved. | |
# | |
# =================================== | |
# class Forum | |
# references_many :topics |
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
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist /tmp/ | |
$ plutil -convert xml1 /tmp/com.googlecode.iterm2.plist | |
$ vi /tmp/com.googlecode.iterm2.plist # ... do whatever you want | |
You can convert it back to a binary file with | |
$ plutil -convert binary1 FILENAME |
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
# =================================================================================================================== | |
# Template for generating a no-frills Rails application with support for ElasticSearch full-text search via Tire | |
# =================================================================================================================== | |
# | |
# This file creates a basic, fully working Rails application with support for ElasticSearch full-text search | |
# via the Tire gem [http://github.com/karmi/tire]. | |
# | |
# You DON'T NEED ELASTICSEARCH INSTALLED, it is installed and launched automatically by this script. | |
# | |
# Requirements |
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
group :assets do | |
gem 'sass-rails', ">= 3.1" | |
gem 'coffee-rails', ">= 3.1" | |
gem 'uglifier' | |
gem "compass", ">= 0.12.alpha.0" | |
gem 'compass_twitter_bootstrap' | |
end |
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 sh | |
#After forking and editing YOUR_ORG to point at the right repo can be run via: | |
#bash <(curl -s https://raw.github.com/gist/THEIDOFYOURFORKEDGIST) | |
#if you use `curl xxx | sh` input will be messed up and there will be no pauses | |
#I keep XCode and gcc on a thumbdrive along with java, for speeding things up | |
#http://support.apple.com/downloads/DL1421/en_US/JavaForMacOSX10.7.dmg | |
read -p "Install XCode or gcc (http://github.com/kennethreitz/osx-gcc-installer)" | |
#setup your ssh keys for github |
OlderNewer