Skip to content

Instantly share code, notes, and snippets.

View jaischeema's full-sized avatar

Jais Cheema jaischeema

View GitHub Profile
@jaischeema
jaischeema / promises.re
Created June 28, 2018 22:47 — forked from lilactown/promises.re
Notes on using JavaScript Promises in ReasonML/BuckleScript
/**
* Making promises
*/
let okPromise = Js.Promise.make((~resolve, ~reject as _) => [@bs] resolve("ok"));
/* Simpler promise creation for static values */
Js.Promise.resolve("easy");
Js.Promise.reject(Invalid_argument("too easy"));
@jaischeema
jaischeema / database.rake
Created April 4, 2016 03:35
Copy Heroku production database to local database
# http://blog.mccartie.com/2016/03/22/copy-heroku-database-to-local.html?utm_source=rubyweekly&utm_medium=email
namespace :db do
desc "Copy production database to local"
task :copy_production => :environment do
# Download latest dump
system("wget -O tmp/latest.dump `heroku pg:backups public-url -q`")
# get user and database name