🏋️♂️
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
➜ ~ pry | |
[1] (pry) main: 0> '1.3.13' < '1.3.8' | |
=> true |
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
➜ project: bower install angular --save | |
bower angular#* cached git://github.com/angular/bower-angular.git#1.3.13 | |
bower angular#* validate 1.3.13 against git://github.com/angular/bower-angular.git#* | |
bower angular#~1.3.13 install angular#1.3.13 | |
bower no-json No bower.json file to save to, use bower init to create one | |
angular#1.3.13 bower_components/angular |
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] (pry) main: 0> Gem::Version.new('1.3.8') > Gem::Version.new('1.3.13') | |
=> false | |
[2] (pry) main: 0> '1.3.8' > '1.3.13' | |
=> true |
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/ips' | |
Benchmark.ips do |x| | |
array = Array.new(10*10) { rand(10) } | |
x.report('to_string', array.to_s) | |
x.report('interpolation', "#{array}") | |
x.compare! | |
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
Rails.application.routes.draw do | |
Pathname.new(Rails.root.join('config/routes/')).each_child do |route| | |
instance_eval File.read route | |
end | |
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
scope module: :juice_categories do | |
resources 'juice_categories', only: %i(index show), path: 'juice-categories' | |
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
# lib/rails_routes_reloader.rb | |
class RailsRoutesReloader | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
reload_routes_if_changed | |
return *@app.call(env) |
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
.directive 'arrowListener', -> | |
restrict: 'A' | |
scope: | |
moveRight: '&' | |
moveLeft: '&' | |
link: (scope, elm, attrs) -> | |
elm.bind 'keydown', (e) -> | |
scope.moveRight() if e.keyCode == 39 | |
scope.moveLeft() if e.keyCode == 37 |
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
.directive 'arrowListener', -> | |
restrict: 'A' | |
scope: | |
moveRight: '&' | |
moveLeft: '&' | |
link: (scope, elm, attrs) -> | |
elm.bind 'keydown', (e) -> | |
scope.moveRight() if e.keyCode == 39 | |
scope.moveLeft() if e.keyCode == 37 | |
$scope.$apply() |
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
.directive 'arrowListener', -> | |
restrict: 'A' | |
scope: | |
moveRight: '&' | |
moveLeft: '&' | |
link: (scope, elm, attrs) -> | |
elm.bind 'keydown', (e) -> | |
$scope.$apply -> | |
scope.moveRight() if e.keyCode == 39 | |
scope.moveLeft() if e.keyCode == 37 |