Skip to content

Instantly share code, notes, and snippets.

View tilsammans's full-sized avatar

Joost Baaij tilsammans

View GitHub Profile
module Paperclip
class Geometry
def self.from_file file
parse("100x100")
end
end
class Thumbnail
def make
src = Test::FileHelper.fixture_file('white_pixel.jpg')
dst = Tempfile.new([@basename, @format].compact.join("."))
@ahoward
ahoward / array-matches.rb
Created February 3, 2011 19:31
this is a simple way to look for > 1 element array matches
candidate = %w( c b a )
target = %w( a b )
found! if(target & candidate == target)
@ValentinFunk
ValentinFunk / NetlifyServerPushPlugin.js
Last active May 4, 2024 04:24
Webpack - Generate Netlify HTTP2 Server Push _headers File when using the HtmlWebpackPlugin
/**
* Generate a Netlify HTTP2 Server Push configuration.
*
* Options:
* - headersFile {string} path to the _headers file that should be generated (relative to your output dir)
*/
function NetlifyServerPushPlugin(options) {
this.options = options;
}