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
body{ | |
overflow: hidden; | |
} |
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
icons = | |
preview: "Print Preview" | |
edit: "Edit Question" | |
comment: "Comment" | |
trash: "Delete" | |
for icon, text of icons | |
$(this.el).find(".#{icon}-image").tooltip | |
title: text |
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
for f in *.yaml; do mv $f `basename $f .yaml`.yml; done; |
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 Instruments2.Views.FilterQuestionSets extends Backbone.View | |
template: JST['folders/filter'] | |
id: "filter-question-sets" | |
className: "clearfix" | |
events: | |
"keyup input[type=text]": "filter" |
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
validates_presence_of(self.column_names - ["id", "created_at", "updated_at"]) |
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
module Foobar | |
def self.foo | |
puts 'foo' | |
end | |
end | |
module Foobar | |
def self.bar | |
puts 'bar' | |
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
echo "$PATH" | /usr/bin/awk -v RS=':' -v ORS=":" '!a[$1]++' |
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
(1..100).to_a.map { |i| | |
if (i % 3 == 0 ) && (i % 5 == 0) | |
i = "fizzbuzz" | |
elsif i % 3 == 0 | |
i = "fizz" | |
elsif i % 5 == 0 | |
i = "buzz" | |
else | |
i = i | |
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
require 'benchmark' | |
arr1 = (1..5000).to_a | |
arr2 = (1..10000).to_a | |
a = arr1.zip(arr2).flatten # 10000 items, 5000 duplicates | |
# with #uniq | |
puts Benchmark.measure { a.uniq } | |
# Total time |
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
- Start Redis | |
redis-server /usr/local/etc/redis.conf | |
- Start Resque | |
rake resque:work QUEUE="*" | |
- Start Rails last |