Skip to content

Instantly share code, notes, and snippets.

View Cohen-Carlisle's full-sized avatar
🥔
Potatomancer.

Cohen Carlisle Cohen-Carlisle

🥔
Potatomancer.
View GitHub Profile
@Cohen-Carlisle
Cohen-Carlisle / chelixir
Created August 28, 2019 19:00
Change elixir and erlang versions at the same time using kiex and kerl
#! /usr/bin/env bash
# this script wraps kiex and kerl to activate the correct elixir and erlang
# versions in concert with each other and must be sourced, not executed
# mapping of elixir versions to compatible erlang versions
declare -A ex2erl
ex2erl[1.0.0]=17.0
ex2erl[1.1.0]=18.0
ex2erl[1.2.0]=18.0
@Cohen-Carlisle
Cohen-Carlisle / edex
Created August 12, 2018 19:43
exercism download elixir
edex() {
local dir=$(exercism download --uuid=$1)
echo $dir
cd $dir
sed -i -- 's/^ @tag :pending/ # @tag :pending/g' *_test.exs
elixir *_test.exs
}
@Cohen-Carlisle
Cohen-Carlisle / mfdiff
Last active August 14, 2018 16:49
Mimics what I'd like `mix format --diff FILE` to do. The diff behaves like `git diff`.
mfdiff() {
cat $1 |
mix format - |
diff --unified --color=always $1 - |
less --raw-control-chars --quit-if-one-screen --no-init
}

Keybase proof

I hereby claim:

  • I am cohen-carlisle on github.
  • I am cohen_carlisle (https://keybase.io/cohen_carlisle) on keybase.
  • I have a public key ASAslg__4Tws1wHWZmGqz0P7-pGKOLycvgKwj5zHCtgMeAo

To claim this, I am signing this object:

@Cohen-Carlisle
Cohen-Carlisle / ubuntu-setup-journal.md
Last active April 7, 2018 22:16
Ubuntu Setup Journal
@Cohen-Carlisle
Cohen-Carlisle / rort
Last active June 21, 2016 01:30
rort
#!/bin/bash
xdg-open &>/dev/null https://www.railstutorial.org/book/filling_in_the_layout#cha-filling_in_the_layout &
#!/usr/bin/env ruby
require 'httparty'
require 'sendgrid-ruby'
if (ARGV.length > 2 || ARGV.length == 0)
abort 'Usage: wikispam SEND_TO_EMAIL_ADDRESS [NUMBER_OF_EMAILS]'
end
send_to = ARGV[0]
@Cohen-Carlisle
Cohen-Carlisle / succ
Created April 9, 2015 01:08
Barbaric #succ
###############################################################################
# #
# Returns the successor to str. The successor is calculated by incrementing #
# characters starting from the rightmost alphanumeric (or the rightmost #
# character if there are no alphanumerics) in the string. Incrementing a #
# digit always results in another digit, and incrementing a letter results in #
# another letter of the same case. Incrementing nonalphanumerics uses the #
# underlying character set’s collating sequence. #
# #
# If the increment generates a “carry,” the character to the left of it is #