Skip to content

Instantly share code, notes, and snippets.

View Dockerfile
# STEP 1 - BUILD RELEASE
# cannot use alpine 3.14.0 because of issue here with bcrypt-elxir compiling using make on docker:
# https://github.com/riverrun/bcrypt_elixir/issues/26#issuecomment-881966412
FROM hexpm/elixir:1.12.3-erlang-24.0.6-alpine-3.13.5 AS build
# install build dependencies
RUN apk add --update git \
build-base \
nodejs-current \
nodejs-npm \
View console.log
key s3_key: "7365f9db-c0cc-457a-bd8a-e69f48d740fd.jpg"
fields: %{
"acl" => "public-read",
"content-type" => "image/jpeg",
"key" => "7365f9db-c0cc-457a-bd8a-e69f48d740fd.jpg",
"policy" => "ewogICJleHBpcmF0aW9uIjogIjIwMjEtMDctMjBUMDM6MDk6MjguNDcxMTA3WiIsCiAgImNvbmRpdGlvbnMiOiBbCiAgICB7ImJ1Y2tldCI6ICAid2l0cm9vcy1tYWluIn0sCiAgICBbImVxIiwgIiRrZXkiLCAiNzM2NWY5ZGItYzBjYy00NTdhLWJkOGEtZTY5ZjQ4ZDc0MGZkLmpwZyJdLAogICAgeyJhY2wiOiAicHVibGljLXJlYWQifSwKICAgIFsiZXEiLCAiJENvbnRlbnQtVHlwZSIsICJpbWFnZS9qcGVnIl0sCiAgICBbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwgMCwgODAwMDAwMF0sCiAgICB7IngtYW16LXNlcnZlci1zaWRlLWVuY3J5cHRpb24iOiAiQUVTMjU2In0sCiAgICB7IngtYW16LWNyZWRlbnRpYWwiOiAiMUNCQ0M5NUQwQTRCNEU3RDA5QTMvMjAyMTA3MjAvdXMtZWFzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LAogICAgeyJ4LWFtei1hbGdvcml0aG0iOiAiQVdTNC1ITUFDLVNIQTI1NiJ9LAogICAgeyJ4LWFtei1kYXRlIjogIjIwMjEwNzIwVDAzMDkyOFoifQogIF0KfQo=",
"x-amz-algorithm" => "AWS4-HMAC-SHA256",
"x-amz-credential" => "1CBCC95D0A4B4E7D09A3/20210720/us-east-1/s3/aws4_request",
"x-amz-date" => "20210720T030
View dev.exs
config :faithful_word, FaithfulWordWeb.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: [
yarn: ["run", "watch", cd: Path.expand("../assets", __DIR__)]
]
View gist:d41f7ecb5beb420dbada670112fd61eb
UPDATE on my tailwind/jit/webpack5/docker adventures:
I used these docker image deps instead:
`webpack docker build`:
```
FROM node:14.15.5-alpine3.13 AS webpack
LABEL maintainer="Nick Janetakis <nick.janetakis@gmail.com>"
View docker.yml
---
- name: Install aptitude using apt
apt:
name: aptitude
state: latest
update_cache: yes
force_apt_get: yes
- name: Install haveged
apt:
View 20200823103159_create_users_auth_tables.exs
defmodule FaithfulWord.Repo.Migrations.CreateUsersAuthTables do
use Ecto.Migration
def change do
execute "CREATE EXTENSION IF NOT EXISTS citext", ""
create table(:users, primary_key: false) do
add :id, :binary_id, primary_key: true
add :email, :citext, null: false
add :username, :citext
View 20200823104159_create_channels.exs
defmodule FaithfulWord.Repo.Migrations.CreateChannels do
use Ecto.Migration
def change do
create table(:channels, primary_key: false) do
add :id, :binary_id, primary_key: true
add :basename, :string
add :description, :text
add :ordinal, :integer
add :private, :boolean
@mazz
mazz / ContentView.swift
Last active Mar 16, 2021
swiftui CardViewModifier
View ContentView.swift
//
// ContentView.swift
// MixedInsets2
//
// Created by Michael Hanna on 2021-03-11.
//
import SwiftUI
struct ContentView: View {
View error.log
[error] GenServer #PID<0.1292.0> terminating
** (ArgumentError) assign @inner_content not available in eex template.
Please make sure all proper assigns have been set. If this
is a child template, ensure assigns are given explicitly by
the parent template as they are not automatically forwarded.
Available assigns: [:__changed__, :action, :flash, :id, :inner_block, :myself, :socket, :state]
(phoenix_live_view 0.15.0) lib/phoenix_live_view/engine.ex:870: Phoenix.LiveView.Engine.fetch_assign!/2
@mazz
mazz / console_commands.log
Last active Feb 15, 2021
jekyll deploy static site
View console_commands.log
## jekyll deploy
adduser jekyll
adduser jekyll sudo
su jekyll ; cd /home
mkdir ~/.ssh ; cd .ssh
cat >> ~/.ssh/authorized_keys
ssh-rsa <pubkey>
sudo chmod 700 -R ~/.ssh && chmod 600 ~/.ssh/authorized_keys
mkdir -p /home/jekyll/static/my_app