Skip to content

Instantly share code, notes, and snippets.

@chrisjsimpson
chrisjsimpson / dokku-issue-5743- Procfile.438884.missing.md
Last active March 16, 2023 12:06
Dokku Procfile.438884.missing: no such file or directory when Initializing an app repository from a remote repository https://github.com/dokku/dokku/issues/5743
package main
import "github.com/stripe/stripe-go/v74"
import "github.com/stripe/stripe-go/v74/account"
import "encoding/json"
import "fmt"
import "os"
func main() {
stripe_api_key := os.Getenv("STRIPE_API_KEY")
import stripe
import os
STRIPE_API_KEY = os.getenv("STRIPE_API_KEY")
stripe.api_key = STRIPE_API_KEY
accounts = stripe.Account.list(limit=3)
for account in accounts.auto_paging_iter():
if (

blank slate setup

install dokku, visit in browser to complete install genrate ssh key for github actions/dokku server using ssh-keygen, and copy the private key to the github repo secrets.

Create front-end app

dokku apps:create front-end

@chrisjsimpson
chrisjsimpson / main.go
Created July 25, 2021 18:02
Go postgres connect to database
import "fmt"
import "os"
import "log"
import (
"database/sql"
_ "github.com/lib/pq"
)
func main() {
@chrisjsimpson
chrisjsimpson / app.py
Created April 5, 2021 12:54
poor mans aws
import subprocess
from random import randrange
from flask import Flask
def create_app():
app = Flask(__name__)
@app.route('/')
def create_container():
container_id = randrange(1000,9000)
@chrisjsimpson
chrisjsimpson / connect-subscription-fake-flow.sh
Created November 24, 2020 22:23
Stripe connect create subscription and trigger trial, finalise invoice and confirm payment
# Create a customer
CONNECT_ACCOUNT_ID=acct_abc123
CUSTOMER_ID=`stripe customers create --stripe-account=$CONNECT_ACCOUNT_ID | jq -r .id`
# Create a payment method
PAYMENT_METHOD=`stripe payment_methods create --stripe-account=$CONNECT_ACCOUNT_ID \
--type=card \
-d "card[number]"=4242424242424242 \
-d "card[exp_month]"=11 \
-d "card[exp_year]"=2021 \
@chrisjsimpson
chrisjsimpson / main.py
Created December 25, 2019 18:40
Pack of cards
from pprint import pprint
import random
#Order of importance
suit = ['ace', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'jack', 'queen', 'king']
def build_pack():
''' Builds and returns a pack of sorted cards'''
cards = [] # Empty list of cards to be built
# Build hearts
@chrisjsimpson
chrisjsimpson / dms2dec.py
Created April 1, 2019 12:17 — forked from jeteon/dms2dec.py
Convert coordinates in DMS notation to decimal in Python.
#!/env/python
# coding=utf8
"""
Converting Degrees, Minutes, Seconds formatted coordinate strings to decimal.
Formula:
DEC = (DEG + (MIN * 1/60) + (SEC * 1/60 * 1/60))
Assumes S/W are negative.
@chrisjsimpson
chrisjsimpson / get-direct-login.py
Created March 25, 2019 20:04
OBP generate direct login token
'''
You need to install pythin requests library for this to work
e.g. pip install requests
You also need to use python3
'''
import requests
consumer_key = input("Consumer Key --> ")
username = input("Username --> ")
password = input("Password --> ")