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 KM | |
@id = nil | |
@key = nil | |
class << self | |
def init(key) | |
@key = key | |
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
# =================================================================================================================== | |
# 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
# Rails.root/config.ru | |
require "./config/environment" | |
run ActionController::Dispatcher.new |
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
<div id="user_nav"> | |
<% if user_signed_in? %> | |
<img src="<%= user_avatar %>" id="main_avatar"> Signed in as <%= current_user.email %>.<br /> | |
Not you? | |
<% if session[:fb_token].nil? %> | |
<%= link_to "Sign out", destroy_user_session_path %> | |
<% else %> | |
<%= link_to "Sign out", facebook_logout_path %> | |
<% 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
# Move this file to ~/.config/pianobar/config | |
# User | |
user = PANDORA_USERNAME | |
password = PANDORA_PASSWORD | |
# Change this to where your scrobble.py file is | |
event_command = ~/.config/pianobar/scrobble.py |
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 'formula' | |
require 'hardware' | |
class Postgresql <Formula | |
homepage 'http://www.postgresql.org/' | |
url 'http://ftp.riken.go.jp/pub/FreeBSD/distfiles/postgresql/postgresql-8.4.4.tar.bz2' | |
md5 '4bf2448ad965bca3940df648c02194df' | |
depends_on 'readline' | |
depends_on 'libxml2' if MACOS_VERSION < 10.6 # Leopard libxml is too old |
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
gem 'couchrest_extended_document' |
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
BEGIN { | |
require 'net/http' | |
Net::HTTP.module_eval do | |
alias_method '__initialize__', 'initialize' | |
def initialize(*args,&block) | |
__initialize__(*args, &block) |
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
// | |
// Backbone.Rails.js | |
// | |
// Makes Backbone.js play nicely with the default Rails setup, i.e., | |
// no need to set | |
// ActiveRecord::Base.include_root_in_json = false | |
// and build all of your models directly from `params` rather than | |
// `params[:model]`. | |
// | |
// Load this file after backbone.js and before your application JS. |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |