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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="mapTo"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.umd.js"></script> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="mapTo"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.umd.js"></script> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="mapTo"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.umd.js"></script> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
viewport_width = $(window).width() | |
ideal_height = parseInt($(window).height() / 2) | |
summed_width = photos.reduce ((sum, p) -> sum += p.get('aspect_ratio') * ideal_height), 0 | |
rows = Math.round(summed_width / viewport_width) | |
if rows < 1 | |
# (2a) Fallback to just standard size | |
photos.each (photo) -> photo.view.resize parseInt(ideal_height * photo.get('aspect_ratio')), ideal_height | |
else | |
# (2b) Distribute photos over rows using the aspect ratio as weight |
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 customOpts = { | |
entries: [config.jsES6MainFile], | |
debug: true, | |
transform: ['babelify'] | |
}; | |
var opts = _.assign({}, watchify.args, customOpts); | |
var b = watchify(browserify(opts)); | |
gulp.task('scripts', bundle); | |
b.on('update', bundle); |
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 deploy(env) { | |
var bucketSuffix = env === 'staging' ? '-staging' : ''; | |
var publisher = $.awspublish.create({ | |
key: 'xxxx', | |
secret: 'xxx', | |
bucket: 'picaly.co' + bucketSuffix, | |
region: 'eu-west-1' | |
}); | |
return gulp.src('./dist/**/*') |
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
module Heroku | |
module Rake | |
class Task | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
end | |
def self.[](name) | |
Heroku::Rake::Task.new(name) |
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 implementation causes error: | |
# ArgumentError: wrong number of arguments (0 for 1..3) | |
# config.ru:10:in `instance_eval' | |
# config.ru:10:in `initialize' | |
# config.ru:26:in `new' | |
# config.ru:26:in `block in inner_app' | |
# /Users/ograbek/.rvm/gems/ruby-2.1.2@owning_rails/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval' | |
# /Users/ograbek/.rvm/gems/ruby-2.1.2@owning_rails/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize' | |
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
Make symlink: | |
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime | |
And then open and edit .bash_profile: | |
export EDITOR='sublime -w' |