This file contains hidden or 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
| window.App = | |
| Models: {} | |
| Collections: {} | |
| Views: {} | |
| Routers: {} | |
| init: (options) -> | |
| App.project = options.project | |
| App.question_set = options.question_set | |
| App.router = new App.Routers.QuestionsRouter() | |
| Backbone.history.start(); |
This file contains hidden or 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
| position: relative; | |
| white-space: pre; | |
| padding: 10px; | |
| float: right; | |
| width: 380px; | |
| font-size: 12px; | |
| font-family: 'Courier new'; | |
| font-weight: bold; | |
| background: rgba(0, 0, 0, 0.15); | |
| border-radius: 4px; |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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; |