Skip to content

Instantly share code, notes, and snippets.


Zach Porter zporter

View GitHub Profile
zporter /
Created Feb 25, 2020
Book Club: Peak: Secrets from the New Science of Expertise

Purposeful practice has well-defined, specific goals.

You seldom improve much without giving the task your full attention.

Purposeful practice involves feedback.

Purposeful practice requires getting out of one’s comfort zone.

Recent studies have shown that learning a new skill is much more effective at triggering structural changes in the brain than simply continuing to practice a skill that one has already learned. On the other hand, pushing too hard for too long can lead to burnout and ineffective learning. The brain, like the body, changes most quickly in that sweet spot where it is pushed outside—but not too far outside—its comfort zone.

zporter / github_pr.plugin.zsh
Created Jun 28, 2019
Oh-my-zsh plugin for opening a Github PR
View github_pr.plugin.zsh
function github_repo_path() {
git remote -v | egrep -io -m 1 "[:/]([a-z/-]+)" | sed 's/[:\/]//'
function ggpr {
open "$(github_repo_path)/pull/new/$(git_current_branch)"
zporter / iex
Created Sep 12, 2018
Elixir: Parsing initials of a given name
View iex
iex(2)> c "name.ex"
iex(3)> Name.initials("Cher")
iex(4)> Name.initials("Barry Bluejeans")
iex(5)> Name.initials("Jean-Claude Van Damme")
View gist:5f01506a25eead8e9da5dfaae0d572a5
Verifying my Blockstack ID is secured with the address 19UwLitPtt5ATRM9S15SWGapysWpoH2FkG
zporter / fibonacci.ex
Created Jan 29, 2018
Elixir: Fibonacci
View fibonacci.ex
defmodule Fibonacci do
@moduledoc """
In mathematics, the Fibonacci numbers are the numbers in the following
integer sequence, called the Fibonacci sequence, and characterized by the
fact that every number after the first two is the sum of the two preceding
@doc """
Finds the nth fibonacci number.

Keybase proof

I hereby claim:

  • I am zporter on github.
  • I am zporter ( on keybase.
  • I have a public key ASDF_VC9qoitBmHWspNxiCHDK5xSnpiD9wRHKM7UrNbvtAo

To claim this, I am signing this object:

zporter / .spacemacs
Created May 26, 2017
Spacemacs config
View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
;; Base distribution to use. This is a layer contained in the directory
zporter / address.ex
Last active May 17, 2017
Ecto: Embedded Schemas
View address.ex
use Ecto.Schema
import Ecto.Changeset
@type t :: module
# A required field for all embedded documents
@primary_key {:id, :binary_id, autogenerate: true}
schema "" do
zporter / form_helpers.ex
Created Mar 6, 2017
Simple Form example for Phoenix
View form_helpers.ex
defmodule AppName.FormHelpers do
@doc """
Generates a form input tag
<%= input f,
input: [
placeholder: gettext("What should we call you?"),
zporter / parsing.lhs
Created Dec 3, 2015
EDX: FP 101 Parser
View parsing.lhs
> module Parsing where
> import Data.Char
> import Control.Monad
> import Control.Applicative
> infixr 5 +++
The monad of parsers