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
# This line makes me sad | |
Faraday::Adapter.register_middleware File.expand_path(File.dirname(__FILE__)), | |
:certificate_pinning => [:CertificatePinning, 'certificate_pinning/certificate_pinning'] | |
Faraday.new(:url => 'https://fancy-startup.io/api') do |f| | |
f.use :http_cache, store: @cache | |
f.request :url_encoded | |
f.response :logger | |
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
# Rig up livereload for frontend stuff | |
guard 'livereload', apply_js_live: false, apply_css_live: true do | |
# Do full reloads for everything except CSS | |
watch(%r{.+\.(js|coffee|erb)$}) | |
# Do full reloads when we modify the bom.json file with | |
# our Javascripts listed in loading order | |
watch(%r{.+\/bom\.json$}) | |
# Using live compilation has it's downsides. |
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
import nuke,os | |
IMPULSE_FILTER_ENUM = 0 | |
__version__ = (0,0,1) | |
def grow(): | |
""" | |
Will make a Crop node that crops the frame to the union of the animated BBox of the nude currently selected. | |
For example, if you have a Tracker node that stabilizes an image this function will grow your bounding box | |
to include the whole stabilized image | |
""" |
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
alias buby='bundle exec ruby' | |
alias brake='bundle exec rake' | |
alias bapistrano='bundle exec cap' | |
alias brackup='bundle exec rackup' | |
alias breakup='bundle exec rackup' | |
alias brails='bundle exec rails' | |
alias botgun='bundle exec shotgun --port 9292' | |
alias boreman='bundle exec foreman start' | |
alias brunicorn='bundle exec unicorn --port 9292' | |
alias bundel='bundle' # how Dutch |
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
# A module that allows us to send Backbone events up the tree of components | |
ReactTelegraph = | |
componentWillMount: -> | |
# Make BB events available to the component | |
_.extend @, Backbone.Events | |
componentWillUnmount: -> | |
# Remove all Backbone event listeners | |
@off null, null, null | |
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 'open-uri' | |
require 'pp' | |
gemname = 'sass' | |
arr = Marshal.load(open("https://rubygems.org/api/v1/dependencies?gems=#{gemname}")) | |
arr.sort! do | g1, g2 | | |
Gem::Version.new(g1[:number]) <=> Gem::Version.new(g2[:number]) | |
end | |
# Now go grep for those dependencies |
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
# Somehow Firefox 3 on Flame Oldest Linux In The Universe | |
# gets the .tgz files double-cooked compressed. This MW is | |
# intrduced to verify why that happens | |
class HeaderSniffer | |
def initialize(app, path_regexp = /\.tgz/) | |
@path_regexp = path_regexp | |
@app = app | |
end | |
def 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
curl http://logik-matchbook.org/MatchboxShaderCollection.tgz | tar xfz -; cp -r shaders /wherever-you-want/ |
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
curl http://logik-matchbook.org/MatchboxShaderCollection.tgz | tar xfz - && ./INSTALL.command |
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 'openssl' | |
def digest_file(file_path, digest_class) | |
chunk_size = 1024 * 1024 # a meg | |
d = digest_class.new | |
File.open(file_path, 'r') do | f | | |
while chunk = f.read(chunk_size) do | |
d << chunk | |
end | |
end |