This file contains 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 tempRedirect(req, res) { | |
var filename = req.params[0]; | |
var params = { | |
Bucket: S3_BUCKET, | |
ResponseContentDisposition: 'inline; filename=' + filename.replace(/,/, '_'), | |
Key: checkTrailingSlash(getFileKeyDir(req)) + filename | |
}; | |
var s3 = new aws.S3(s3Options); | |
s3.getSignedUrl('getObject', params, function(err, url) { | |
res.redirect(url); |
This file contains 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
const MAX_WIDTH = 512 | |
const applyBilinearInterpolation = (srcCanvasData, destCanvasData, scale) => { | |
function inner(f00, f10, f01, f11, x, y) { | |
const unX = 1.0 - x | |
const unY = 1.0 - y | |
return (f00 * unX * unY + f10 * x * unY + f01 * unX * y + f11 * x * y) | |
} | |
let i | |
let j |
This file contains 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
export const getFeedItem = feedItemId => ( | |
{ | |
type: GET_FEED_ITEM, | |
ajax: true, | |
payload: { | |
type: 'get', | |
route: `/feed/${feedItemId}`, | |
pending: GET_FEED_ITEM_PENDING, | |
success: GET_FEED_ITEM_SUCCESS, | |
failure: GET_FEED_ITEM_FAILURE, |
This file contains 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 app.Eventable | |
callbackRegistry = {} | |
@off: (event, callback) -> | |
callbacks = callbackRegistry[event] | |
callbackRegistry[event] = _.without(callbacks, callback) | |
@on: (event, callback) -> | |
if typeof callback == "function" |
This file contains 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.exports = (grunt) -> | |
grunt.loadNpmTasks('grunt-contrib-coffee') | |
grunt.loadNpmTasks('grunt-contrib-jade') | |
grunt.loadNpmTasks('grunt-contrib-sass') | |
grunt.loadNpmTasks('grunt-contrib-watch') | |
grunt.loadNpmTasks('grunt-contrib-connect') | |
grunt.loadNpmTasks('grunt-contrib-clean') | |
grunt.loadNpmTasks('grunt-contrib-copy') |
This file contains 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
customer = Stripe::Customer.create({ | |
description: "Foo Bar", | |
email: "[email protected]", | |
card: nil, | |
plan: 'super_awesome_plan', | |
coupon: 'super_awesome_coupon' | |
}) |
This file contains 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 Schedule | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
OPTIONS_FOR_TIMEZONES = [ | |
['Pacific Time (GMT -8:00)', "Pacific Time (US & Canada)"], | |
['Eastern Time (GMT -5:00)', "Eastern Time (US & Canada)"], | |
['Central Time (GMT -6:00)', "Central Time (US & Canada)"], | |
['Mountain Time (GMT -7:00)', "Mountain Time (US & Canada)"], |
This file contains 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
→hi, anyone there? | |
Chris Winslett: Hello, how may I assist you? | |
→I think my problem is actually with mongoid | |
→I just added this issue on their github: https://github.com/mongoid/mongoid/issues/2125 | |
→Any thoughts on that? I know you guys work with the mongoid guys for their testing | |
Chris Winslett: Are you running Mongo locally? | |
Chris Winslett: Actually -- turn on logging for Mongoid. | |
→no, I'm using mongohq | |
→:-) | |
Chris Winslett: :) What operations are happening after you 'create!' ? |
This file contains 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
Started POST "/hooks/subscriptions" for 127.0.0.1 at 2012-06-03 14:29:17 -0400 | |
Processing by HooksController#subscriptions as XML | |
Parameters: {"object"=>"event", "type"=>"charge.succeeded", "created"=>1326853478, "livemode"=>false, "id"=>"evt_00000000000000", "data"=>{"object"=>{"object"=>"charge", "failure_message"=>nil, "currency"=>"usd", "disputed"=>false, "card"=>{"fingerprint"=>"8ox7KKeBx8logIox", "type"=>"Visa", "object"=>"card", "address_zip"=>nil, "country"=>"US", "last4"=>"4242", "address_line1"=>nil, "exp_month"=>1, "address_line2"=>nil, "cvc_check"=>"pass", "exp_year"=>2013, "address_country"=>nil, "address_zip_check"=>nil, "name"=>"Flim Flam", "address_state"=>nil, "id"=>"cc_00000000000000", "address_line1_check"=>nil}, "paid"=>true, "invoice"=>"in_00000000000000", "created"=>1338674115, "refunded"=>false, "livemode"=>false, "fee"=>0, "amount_refunded"=>0, "description"=>nil, "id"=>"ch_00000000000000", "amount"=>2900, "fee_details"=>[{"type"=>"stripe_fee", "currency"=>"usd", "application"=>nil, |
This file contains 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
{"object"=>"event", "type"=>"charge.succeeded", "created"=>1326853478, "livemode"=>false, "id"=>"evt_00000000000000", "data"=>{"object"=>{"object"=>"charge", "failure_message"=>nil, "currency"=>"usd", "disputed"=>false, "card"=>{"fingerprint"=>"8ox7KKeBx8logIox", "type"=>"Visa", "object"=>"card", "address_zip"=>nil, "country"=>"US", "last4"=>"4242", "address_line1"=>nil, "exp_month"=>1, "address_line2"=>nil, "cvc_check"=>"pass", "exp_year"=>2013, "address_country"=>nil, "address_zip_check"=>nil, "name"=>"Flim Flam", "address_state"=>nil, "id"=>"cc_00000000000000", "address_line1_check"=>nil}, "paid"=>true, "invoice"=>"in_00000000000000", "created"=>1338674115, "refunded"=>false, "livemode"=>false, "fee"=>0, "amount_refunded"=>0, "description"=>nil, "id"=>"ch_00000000000000", "amount"=>2900, "fee_details"=>[{"type"=>"stripe_fee", "currency"=>"usd", "application"=>nil, "amount"=>0}], "customer"=>"cus_00000000000000"}}, "hook"=>{"object"=>"event", "type"=>"charge.succeeded", "created"=>1326853478, "livemode"=>fa |
NewerOlder