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
[11] pry(main)> hash = Hash.new | |
=> {} | |
[12] pry(main)> hash.merge(:a => 1) | |
=> {:a=>1} | |
[13] pry(main)> hash.inspect | |
=> "{}" | |
[14] pry(main)> hash = hash.merge(:a => 1) | |
=> {:a=>1} | |
[15] pry(main)> hash | |
=> {: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
irb(main):061:0> @taxon.products.unscope(:order).ascend_by_master_price.each do |product| | |
irb(main):062:1* puts product.price | |
irb(main):063:1> end | |
... | |
15.99 | |
... | |
15.99 | |
... | |
22.99 | |
... |
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
[9] pry(main)> def returns_hash | |
[9] pry(main)* { :c => :d } | |
[9] pry(main)* end | |
=> nil | |
[10] pry(main)> a = { :a => :b } | |
=> {:a=>:b} | |
[11] pry(main)> a.merge! returns_hash | |
=> {:a=>:b, :c=>:d} | |
[12] pry(main)> a | |
=> {:a=>:b, :c=>:d} |
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
define(function() { | |
var Board = Class.extend({ | |
paint: function(context) { | |
var width = context.canvas.width, | |
height = context.canvas.height; | |
var padding = 5; | |
for (var i = 0; i < 4; i++) { | |
var line; |
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
*************************************************************************** | |
[FATAL] Spree does not work with the protected_attributes gem installed! | |
You MUST remove this gem from your Gemfile. It is incompatible with Spree. | |
*************************************************************************** |
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 QuickFind | |
attr_accessor :id | |
def initialize(n) | |
@id = Array.new(n) { |e| e = e } | |
end | |
def connect(a, b) | |
c = @id[a] | |
d = @id[b] |
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 QuickUnion | |
attr_accessor :id | |
def initialize(n) | |
@id = Array.new(n) { |e| e = e } | |
end | |
def connect(a, b) | |
@id[b] = a | |
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
class WeightedQuickUnion | |
attr_accessor :id | |
def initialize(n) | |
@id = Array.new(n) { |e| e = e } | |
@size = Array.new(n) { |e| e = 1 } | |
end | |
def connect(a, b) | |
c = parent_of(a) |
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
irb(main):010:0> true * true | |
NoMethodError: undefined method `*' for true:TrueClass | |
from (irb):10 | |
from /Users/sent1nel/.rbenv/versions/2.0.0-p247/bin/irb:12:in `<main>' | |
irb(main):013:0> true - nil | |
NoMethodError: undefined method `-' for true:TrueClass | |
from (irb):13 | |
from /Users/sent1nel/.rbenv/versions/2.0.0-p247/bin/irb:12:in `<main>' | |
irb(main):014:0> nil - true | |
NoMethodError: undefined method `-' for nil:NilClass |
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
var gulp = require('gulp'); | |
var bower = require('gulp-bower'); | |
var del = require('del'); | |
gulp.task('clean', function(cb) { | |
del([ | |
'bower_components' | |
], cb); | |
}); |