- Add the apt buildpack
heroku buildpacks:add --index 1 heroku-community/apt
-
Create a file named
Aptfile
in the app root -
Edit the aptfile with content
# data = DATA.readlines | |
data = File.readlines(ARGV.first) | |
p data | |
.map(&:chomp) | |
.chunk_while { _2 != "" } | |
.map { _1.map(&:to_i) } | |
.map(&:sum) | |
.sort[-3..] |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Confirm subscription</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<link href="css/base.css" rel="stylesheet" /> | |
<script src="https://js.stripe.com/v3/"></script> | |
<script src="subscription.js" defer></script> | |
</head> |
def if_you_ask_for(amount) | |
ask_for = amount | |
fee = 0.30 + (0.029 * amount) | |
receive = amount - fee | |
{ | |
ask_for: ask_for.round(2), | |
fee: fee.round(2), | |
receive: receive.round(2), | |
} |
Dir['./icons/*/*.svg'].each do |file| | |
print "." | |
system "inkscape -w 1024 -h 1024 #{file} -o #{file.gsub('.svg', '.png')}" | |
end |
heroku buildpacks:add --index 1 heroku-community/apt
Create a file named Aptfile
in the app root
Edit the aptfile with content
const stripe = new Stripe(config.STRIPE_SECRET_KEY); | |
const price = await stripe.create("/v1/prices", { | |
unit_amount: 2000, | |
currency: 'usd', | |
product: 'prod_abc' | |
}) | |
const paymentLink = await stripe.create("/v1/payment_links", { |
const myPromise = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve('Success for arrow function promise.'); | |
}, 2000); | |
}); | |
const myNamedPromise = new Promise(function callback(resolve, reject) { | |
setTimeout(() => { | |
resolve('Success for named callback in promise.'); |
function useParameterToFilterArray(filterFn, array) { | |
const filteredArray = []; | |
for (let i = 0; i < array.length; i++) { | |
if (filterFn(array[i])) { | |
filteredArray.push(array[i]); | |
} | |
} | |
return filteredArray; | |
} |
" Leader | |
let mapleader = " " | |
set autowrite " Automatically :write before running commands | |
set backspace=2 " Backspace deletes like most programs in insert mode | |
set et " Expand tabs to spaces | |
set ff=unix " Something about unix | |
set history=50 | |
set incsearch " do incremental searching | |
" set laststatus=2 " Always display the status line |
#!/usr/bin/env bash | |
set -e | |
# Dump prod database into ./heroku.dump | |
curl `heroku pg:backups public-url` > heroku.dump | |
# Drop and recreate the local database | |
rails db:drop db:create |