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
| /** | |
| * 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")); |
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
| # 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 |