Skip to content

Instantly share code, notes, and snippets.

@phortuin
phortuin / signing-git-commits.md
Last active May 14, 2024 15:02
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@kyleVsteger
kyleVsteger / release.Dockerfile
Last active August 8, 2022 18:45
Multistage Elixir 1.11 Phoenix Live View Release Dockerfile
ARG ALPINE_VERSION=3.12.0
FROM hexpm/elixir:1.11.0-erlang-23.1.1-alpine-3.12.0 as builder
ARG APP_VSN="1.0.0"
# Replace `your_app` with your otp application name.
ENV APP_NAME=your_app \
APP_VSN=${APP_VSN} \
MIX_ENV=prod
@aaronNGi
aaronNGi / newscript.sh
Created April 28, 2020 20:38
Boilerplate for new POSIX shell scripts
#!/bin/sh
prog_name=${0##*/}
version=1.0
version_text="Boilerplate for new scripts v$version"
options="h o: q v V"
help_text="Usage: $prog_name [-o <text>] [-hqvV] [<file>]...
Boilerplate for new scripts
@keathley
keathley / .credo.exs
Last active December 30, 2023 16:13
Keathley's credo file
# This file contains the configuration for Credo and you are probably reading
# this after creating it with `mix credo.gen.config`.
#
# If you find anything wrong or unclear in this file, please report an
# issue on GitHub: https://github.com/rrrene/credo/issues
#
%{
#
# You can have as many configs as you like in the `configs:` field.
configs: [
-module(task).
-export([async/1, async/3]).
-export([await/1, await/2, await/3]).
-opaque t() :: #{tpid := pid(), tref := reference()}.
-type await_opts() :: [kill].
-export_type([t/0]).
-export_type([await_opts/0]).
@troyfontaine
troyfontaine / 1-setup.md
Last active May 12, 2024 15:17
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@koudelka
koudelka / lookup.ex
Created October 2, 2015 21:13
Elixir Set Lookup
defmodule Lookup do
@wordfile "words.txt"
@external_resource @wordfile
@times 1_000_000
@words @wordfile |> File.stream! |> Enum.map(&String.strip/1)
@hash_set Enum.into(@words, HashSet.new)
@map_set Enum.into(@words, MapSet.new)
@obmarg
obmarg / tokenizer.clj
Created August 4, 2015 13:36
A naive dictionary based tokenizer in clojure
(ns tokenizer.core)
(defn insert-word
[dict word]
"Inserts a single word into a dictionary tree"
(update-in dict (concat (interpose :children word) [:word]) (fn [orig] word)))
(defn build-dict-tree
[words]
"Builds a dict-tree from a list of words."
@alanpeabody
alanpeabody / my_app.ex
Last active March 24, 2024 13:28
Websockets in Elixir with Cowboy and Plug
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [
dispatch: dispatch
])
@ducky427
ducky427 / core.cljs
Created June 11, 2015 11:31
Facebook's fixed data for reagent. Adapted from https://github.com/ul/fixed-data-table-demo
(ns datatable.core
(:require [reagent.core :as reagent]
[cljsjs.fixed-data-table]))
(def Table (reagent/adapt-react-class js/FixedDataTable.Table))
(def Column (reagent/adapt-react-class js/FixedDataTable.Column))
(defn gen-table
"Generate `size` rows vector of 4 columns vectors to mock up the table."
[size]