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
def body_tag(&blk) | |
controller_name = controller.class.to_s.underscore.gsub(/_controller$/, '').gsub(/\//,'_') | |
action_name = controller.action_name.underscore.gsub(/_/,'-') | |
content_tag(:body, :id => "#{controller_name}-#{action_name}", :class => controller_name, &blk) | |
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
[core] | |
editor = /usr/bin/vim | |
[alias] | |
st = status | |
br = branch | |
d = diff | |
ci = commit -v | |
cia = commit -v -a | |
co = checkout | |
cp = cherry-pick |
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 'autotest/growl' | |
Autotest::Growl::image_dir = File.join(ENV['HOME'], '.autotest-growl') | |
Autotest::Growl::hide_label = true | |
Autotest::Growl::clear_terminal = false | |
rescue LoadError | |
puts "No Growl support -- gem install autotest-growl" | |
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
TARGET=pomodoro | |
MCU=attiny13 | |
CC=/usr/bin/avr-gcc | |
CFLAGS=-g -Os -Wall -mcall-prologues -mmcu=$(MCU) | |
OBJ2HEX=/usr/bin/avr-objcopy | |
AVRDUDE=/usr/bin/avrdude | |
program : $(TARGET).hex | |
sudo $(AVRDUDE) -c usbtiny -p$(MCU) -U flash:w:$(TARGET).hex |
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 'spec_helper' | |
describe ApplicationController do | |
controller do | |
def public; head :ok; end | |
end | |
it "should be successful" do | |
get :public | |
response.should be_ok |
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
import sbt._ | |
class AlgorithmDesignManualProject(info: ProjectInfo) extends DefaultProject(info) { | |
val specs = "org.scala-tools.testing" % "specs" % "1.6.2.1" % "test" | |
} | |
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
bsmith bundler (1-0-stable) $ grep -n -r "no-cache" ./ | |
./lib/bundler/cli.rb:139: method_option "no-cache", :type => :boolean, :banner => | |
bsmith bundler (1-0-stable) $ grep -n -r "no_cache" ./ | |
bsmith bundler (1-0-stable) $ | |
bsmith bundler (1-0-stable) $ git log --oneline | grep "no-cache" | |
4601dde Add install option --no-cache to prevent updating the cache. | |
e4287d2 Add install option --no-cache to prevent updating the cache. | |
bsmith bundler (1-0-stable) $ git show 4601dde | |
commit 4601ddeaaddf2671ecc2baa24f49d9e59e7fcfcb |
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
RegexKit.framework/Headers/RKRegex.h:79:38 Pointer to function type 'NSString *' may not be 'restrict' qualified | |
// The `define restrict` is there because XCode doesn't want to compile | |
// RegexKit with the restrict qualifiers. | |
#define restrict | |
#import <RegexKit/RegexKit.h> |
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
!!! 5 | |
%html{:lang => 'en'} | |
%head | |
%meta{:charset => 'utf-8'} | |
%title Application | |
%link{:href => 'http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css', :rel => 'stylesheet', :type => 'text/css'} | |
%script{:src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'} | |
%body | |
= yield |
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 "nokogiri" | |
doc = Nokogiri.XML(IO.read('products.xml')) | |
@products = doc.xpath("//products/product").map do |p| | |
{ :product_id => p.css("product_id").text, :product_url => p.css("product_url").text } | |
end |