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 Cover = require('../../lib/resizers/resizer_stream'); | |
var Transform = require('stream').Transform; | |
describe("ResizerStream", function() { | |
it("should be a Transform stream", function() { | |
var resizer = new Cover({ height: 100, width: 200 }); | |
expect(resizer).to.be.an.instanceof(Transform); | |
}); |
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
IMAGES = [ | |
"https://s3.amazonaws.com/cdn.blomming.com/items/000/700/192/original/b3a1bc5faa4d6becfe7aa66afaea73f8.png", | |
"https://s3.amazonaws.com/cdn.blomming.com/items/000/700/471/original/52a56d6ce31b8e92572cd667963fa8ba.jpg", | |
"https://s3.amazonaws.com/cdn.blomming.com/items/000/522/509/original/fa7c3bb313a96178cca219c1957d1a06.jpg", | |
"https://s3.amazonaws.com/cdn.blomming.com/items/000/197/874/original/f11b7994af669663301ca5786f6a4d68.jpg", | |
"https://s3.amazonaws.com/cdn.blomming.com/items/000/307/331/original/b3dbbd6ceaa4e5570dda4c9fc5302c1d.jpg", | |
"https://s3.amazonaws.com/cdn.blomming.com/items/000/690/960/original/419b0c8960b73611d5ee4f5a1da3bb54.jpg", | |
"https://s3.amazonaws.com/cdn.blomming.com/items/000/691/008/original/4dc8316656dd7c53c84f65b526d85d03.jpg", | |
"https://s3.amazonaws.com/cdn.blomming.com/items/000/691/012/original/208c30f7afdce678b647e0b38027c409.jpg", |
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 'bundler' | |
Bundler.require | |
project_root = File.expand_path(File.dirname(__FILE__)) | |
assets = Sprockets::Environment.new(project_root) do |env| | |
env.logger = Logger.new(STDOUT) | |
end | |
compass_gem_root = Gem.loaded_specs['compass'].full_gem_path |
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 bitmama = (function($){ | |
var bitmama = window.bitmama || {}; | |
var VIEWPORT = '.carousel_contents_bitmama, .carousel_contents_long_bitmama', | |
SLIDE = '.carousel_scroll_block_bitmama', | |
CONTENT = '.bol_box_threecols, .bol_box_fourcols', | |
CONTENT_BLOCK = '.bol_box_threecols div, .bol_box_fourcols div', | |
PAGERS = '.carousel_pager_bitmama a', | |
ACTIVE = 'active', |
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
#!/bin/sh | |
# adapted from http://stackoverflow.com/questions/489277/script-to-convert-mysql-dump-sql-file-into-format-that-can-be-imported-into-sqlit | |
if [ "x$1" == "x" ]; then | |
echo "Usage: $0 <dumpname>" | |
exit | |
fi | |
cat $1 | | |
grep -v ' KEY "' | | |
grep -v ' UNIQUE KEY "' | | |
grep -v ' PRIMARY KEY ' | |
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 ActiveRecord::Base | |
alias_method 'paperclip_valid?', 'valid?' | |
def valid? | |
ret = paperclip_valid? | |
unless self.class.attachment_definitions.nil? | |
self.class.attachment_definitions.each_key do |attachment| | |
%w(_file_name _content_type _file_size).each do |suffix| |
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
(function(){ | |
var newStylesheet = null; | |
window.addCssClass = function (selector, content){ | |
// ensure presence of head element | |
if(typeof selector === 'string'){ | |
console.log('creating'); |
NewerOlder