Skip to content

Instantly share code, notes, and snippets.

View jonlunsford's full-sized avatar
⌨️
Hacking

Jon Lunsford jonlunsford

⌨️
Hacking
View GitHub Profile
# GET http://ninive-6292.sandbox-quadernoapp.com/api/tax_rates/calculate
my_client.calculate_tax_rate(
amount: 10.0,
currency: "EUR",
from_country: "FR", # CK Customer's business address
to_country: "ES", # Purchaser's location
tax_code: "ebook",
product_type: "good",
tax_behavior: "inclusive"
)
{
"awards": [],
"basics": {
"email": "",
"image": "https://www.gravatar.com/avatar/295bcb1e7e9279bf05ba41a28205d079?s=136&d=identicon&r=PG",
"label": "Engineer @convertkit",
"location": {
"address": "",
"city": "San Luis Obispo",
"country_code": "",
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] Patching process is started!
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] Cleaning! - Cleaning P.A.T.C.H. workspace!
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] Checking version... - Found version 0.3.2.17
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] Version null - False
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] Checking... - Checking for remote service!
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] Looking for software - MastersToolkit
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] PatchEntry - 0.2.6.11>0.2.6.12>vqavo8tddIqTTzav1wqZlX3PWak>ZIP
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] PatchEntry - 0.2.6.12>0.2.7.0>UGyxajxUtUttD5ZCI3Q4xzFR0OY>ZIP
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] PatchEntry - 0.2.7.0>0.2.8.0>sGh1JnReqJ3JBQaE3pD9PXae3nc>ZIP
[P.A.T.C.H. - 5/28/2021 1:09:22 PM] PatchEntry - 0.2.8.0>0.2.9.2>XW2dRa9LMT4D2rcDbKWdqUXc+dE>ZIP
# ./terraform/webhook_processor.tf
provider "aws" {
access_key = "ACCESS_KEY_HERE"
secret_key = "SECRET_KEY_HERE"
region = "us-west1"
}
resource "aws_instance" "webhook_processor" {
ami = "ami-063aa838bd7631e0b" # Ubuntu 18.04
def project do
[
app: :webhook_processor,
version: "0.1.1",
elixir: "~> 1.7",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
# ./lib/mix/taks/docker.ex
defmodule Mix.Tasks.Docker do
use Mix.Task
@shortdoc "Docker utilities for building releases"
def run(["release"]) do
# Build a fresh Elixir image, in case Dockerfile has changed
docker("build -t elixir-ubuntu:latest .")
# Get the current working directory
# ./lib/mix/tasks/docker.build.ex
defmodule Mix.Tasks.Docker.Build do
use Mix.Task
@shortdoc "Docker utilities for building releases"
def run(args) do
Mix.Task.run("docker", args)
end
end
# ./lib/mix/tasks/docker.build.ex
defmodule Mix.Tasks.Docker.Build do
use Mix.Task
@shortdoc "Docker utilities for building releases"
def run(args) do
Mix.Task.run("docker", args)
end
end
#!/usr/bin/env bash
# place this file here:
# ./rel/bin/release
set -e
cd /opt/build
# Install updated versions of hex/rebar
# ./Dockerfile
# ENV matching production target host
FROM ubuntu:18.04
# Mostly locale related env config
# Elixir expects to be built on a system with UTF-8
ENV REFRESHED_AT=2018-08-16 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \