Skip to content

Instantly share code, notes, and snippets.

Avatar

Drew Kerrigan drewkerrigan

View GitHub Profile
@drewkerrigan
drewkerrigan / example-output.txt
Created August 5, 2022 19:05
Math Problem Generator
View example-output.txt
1 x 12 = _____ | 1 x 9 = _____
2 x 4 = _____ | 2 x 5 = _____
3 x 11 = _____ | 3 x 7 = _____
4 x 8 = _____ | 4 x 5 = _____
5 x 7 = _____ | 5 x 12 = _____
6 x 3 = _____ | 6 x 11 = _____
7 x 10 = _____ | 7 x 3 = _____
8 x 8 = _____ | 8 x 11 = _____
9 x 10 = _____ | 9 x 9 = _____
10 x 11 = _____ | 10 x 11 = _____
@drewkerrigan
drewkerrigan / jq_filter_formatting.md
Created October 11, 2021 21:36
Filtering and Formating JSON with JQ
View jq_filter_formatting.md

Create test.json:

cat << 'EOF' > ./test.json
[
  {
    "name": "First1 Last",
    "email": "first1@company.io",
    "state": "A"
 },
@drewkerrigan
drewkerrigan / README.md
Created November 21, 2018 16:54
Pandoc, Mactex, Markdown to PDF
View README.md

I've had to install and configure these things a few times, and I always forget how to do it, so here it is for posterity:

View gist:9db8e88a1e0f6d054c33f256416a4f63

1.11.1 vs 1.3.2 universe configs

diff --git a/repo/packages/M/marathon-lb/8/config.json b/repo/packages/M/marathon-lb/8/config.json
index aef8a4cc..6e25fe94 100644
--- a/repo/packages/M/marathon-lb/8/config.json
+++ b/repo/packages/M/marathon-lb/8/config.json
@@ -19,6 +19,11 @@
           "minimum": 1,
           "type": "number"
@drewkerrigan
drewkerrigan / repro.sh
Created February 16, 2017 16:10
Stdout printing broken in erlang 19.2
View repro.sh
kerl build 19.1 19.1 && kerl install 19.1 ~/erlang/19.1
kerl build 19.2 19.2 && kerl install 19.2 ~/erlang/19.2
mkdir test
cat >test/test_SUITE.erl <<EOL
-module(test_SUITE).
-include_lib("common_test/include/ct.hrl").
-compile([export_all]).
all() ->
[log_test].
@drewkerrigan
drewkerrigan / README.md
Last active October 9, 2018 03:54
Make Local Universe
View README.md

Make Local Universe

Vagrant

Create a CentOS 7 VM:

mkdir centos7
cd centos7
vagrant init madorn/centos7
View drew.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQChLWiHqtsxxrnrjL/kOksOzfQziQFw+dWyui+UcpKAz1tpKNP+pWAcowLamdu6pWq2XDT7RQZ+gulo94qs5VkV26DhkyUar2QKRbXIAH+lP0D/1IzOw/Al20l0lGScbuVrlAJUbjEzXIEKs/oDw8WA6af/U6b5AnHMMHzGibOxyozWgBhfBdRHjsuSzY28DZj/spnEMjd98stcG7fEa5r/lIy4QXswCNv6aWiFJtruTpm03TLTyK3tJsTMOw0ZqO9uYOrA1Fr3La68rA9SBP4bIMlgaxBrct7TEIFHHyD/NZynUmRE9NH3t9YncV4kC/Pt5/9wL5TZRZxAzgpUVt/MAkuv7CbKSOyR9nl0RwvtpOvfsJrX9O0dO8ILPvow2O96ziWPU0Z/VaGJGugiqPq2yzAEWVWm5ejgu0L/nJxtkbVhxYPvg6ncHrKkxaVYj/lxzxJHBmUdL9IFvyIxYrXeG6J1YT9Y1rdJjkq+8pl2gtdboRWYjARHRrLiEckwnwdQ+wCtVzoVoBA0+eEY3AhyxY44vvFJI0axdbOSYm0VWXKWxdOJ6FPBYivxLJGK0ozYPeOnPjS2+/6JoFiDPp59OvghcR3Bb2HsX5NgZM3TpmJPn3JwLXWyfmCZHFGTrDfWih1s2f9dF1wiYM4KLriJFMitj/FlrA2yGVVzP3Kbew== drew@kerrigan.io
@drewkerrigan
drewkerrigan / README.md
Last active February 6, 2018 13:19
Erlang / Elixir in 5 Minutes or Less
View README.md

Learning Erlang / Elixir Basics

Primitives

Erlang only has a few primitives that you need to worry about. Here they are below with corresponding Elixir examples.

  1. integer: Erlang: 123, Elixir: 123
  2. float: Erlang: 123.5, Elixir: 123.5
  3. atom: Erlang: hello, Elixir: :hello
  4. binary: Erlang: &lt;&lt;"hello"&gt;&gt; or &lt;&lt;10,20&gt;&gt;, Elixir: "hello" or &lt;&lt;10,20&gt;&gt;
View config.json
{
"riak": {
"framework-name": "riak",
"hostname": "riak.marathon.mesos",
"marathon": "m1.dcos:8080",
"master": "m1.dcos:5050",
"zk": "m1.dcos:2181",
"user": "root",
"role": "riak",
"auth-principal": "riak",
@drewkerrigan
drewkerrigan / README.md
Last active June 6, 2021 05:41
Setting open files limit in OSX 10.11.3
View README.md

Download this gist, and then run:

chmod 755 open_files_limit_mac.sh
./open_files_limit_mac.sh

Restart the system, and then run: