Skip to content

Instantly share code, notes, and snippets.

@gregstewart
gregstewart / gist:44e8520d479116146fea
Created October 6, 2014 12:39
Compare functions and let me know if you found matching ones (toString comparison)
_.uniq(array.map(function (f) { return f.toString(); }), element.toString())
@gregstewart
gregstewart / gist:dcb0055d3a8bc1cbac2b
Created October 6, 2014 12:40
Compare functions again
_.uniq(array.filter(function (fn) { return fn === element; }))
# This is a comment
FROM ubuntu:14.04
MAINTAINER Greg Stewart <[email protected]>
RUN apt-get update && apt-get install -y curl --assume-yes
RUN \curl -sSL https://get.rvm.io | bash
RUN echo 'source /etc/profile.d/rvm.sh' >> ~/.bashrc
RUN /usr/local/rvm/bin/rvm-shell -c "rvm requirements"
# install Ruby
RUN /usr/local/rvm/bin/rvm-shell -c "rvm autolibs enable"
RUN /usr/local/rvm/bin/rvm-shell -c "rvm install 2.1.4"
@gregstewart
gregstewart / gist:fae1a7be9d2fbbea5fb6
Last active August 29, 2015 14:13
Playing with blocks and partition
class Order
attr_accessor :size, :value
def initialize size, value
@size = size
@value = value
end
end
@gregstewart
gregstewart / gist:74573eea38adc51c1ee6
Last active August 29, 2015 14:13
Different factory patterns
function ObjectFactory () {
this.build = {
chocolate: function () {
console.log('built a chocolate factory');
},
fudge: function () {
console.log('built a fudge factory');
}
}
}