- Install GPG tools
- Install GPG tools and setup pin entry by running:
brew install gnupg pinentry-mac mkdir -m 700 -p ~/.gnupg echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf killall gpg-agent
| {-# LANGUAGE DataKinds #-} | |
| -- | My database API. | |
| module DBAPI where | |
| import Data.Defaults | |
| data ConnSpec p = ConnSpec | |
| { username :: !(Required p String) |
I recently wanted to rename a model and its postgres table in a Phoenix app. Renaming the table was simple and documented, but the table also had constraints, sequences, and indexes that needed to be updated in order for the Ecto model to be able to rely on default naming conventions. I couldn't find any examples of what this would look like but was eventually able to figure it out. For anyone else in the same situation, hopefully this example helps.
In the example below, I'm renaming the Permission model to Membership. This model belongs to a User and an Account, so it has foreign key constraints that need to be renamed.
defmodule MyApp.Repo.Migrations.RenamePermissionsToMemberships do
use Ecto.Migration
SASS Versions of
in Phoenix 1.3 and 1.4 via Webpack
| #!/usr/bin/env bash | |
| # SOURCE: https://eligiblestore.com/blog/2017/05/02/how-to-install-mosh-on-centos/ | |
| # ensure running as root | |
| if [[ "$(id -u)" != "0" ]]; then | |
| exec sudo "$0" "$@" | |
| fi | |
| # install mosh | |
| yum install -y epel-release |
| theme: Sketchnote, 7 | |
| build-lists: false | |
| slidenumbers: true | |
| autoscale: true | |
| --- | |
| # Functional Programming Paradigms In Elixir | |
| - Objectives: | |
| - Understand functional programming a bit better |
| #! /usr/bin/env ruby | |
| # NOTE: Requires Ruby 2.1 or greater. | |
| # This script can be used to parse and dump the information from | |
| # the 'html/contact_info.htm' file in a Facebook user data ZIP download. | |
| # | |
| # It prints all cell phone call + SMS message + MMS records, plus a summary of each. | |
| # | |
| # It also dumps all of the records into CSV files inside a 'CSV' folder, that is created |
| # HELP mothership_collector_working Is the master process collector able to collect metrics | |
| # TYPE mothership_collector_working gauge | |
| mothership_collector_working 1 | |
| # HELP mothership_collector_rss total memory used by collector process | |
| # TYPE mothership_collector_rss gauge | |
| mothership_collector_rss 243605504 | |
| { | |
| "version": "2.0.0", | |
| "tasks": [ | |
| { | |
| "label": "build", | |
| "type": "shell", | |
| "command": "mix compile", | |
| "group": { | |
| "kind": "build", | |
| "isDefault": true |