Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Tim Austin neenjaw

🏠
Working from home
Block or report user

Report or block neenjaw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View concepts.md

Elixir Concepts

A working document.

  • basic types
    • integer
    • hex, octal, and boolean integer forms
    • float
    • scientific notation float form
    • boolean
@neenjaw
neenjaw / compile_error_results.json
Last active Jan 18, 2020
test runner example output on elixir solutions, manually pretty printed
View compile_error_results.json
{
"status": "fail",
"message": "Compiling 1 file (.ex)\n\n== Compilation error in file lib/words.ex ==\n** (TokenMissingError) lib/words.ex:20: missing terminator: end (for `do` starting at line 1)\n (elixir) lib/kernel/parallel_compiler.ex:229: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7",
"tests": []
}
@neenjaw
neenjaw / bowling.ex
Last active Dec 8, 2019
Rescuing the bowling example
View bowling.ex
defmodule Bowling do
# ...
def test_all_last() do
ll = [
{:invalid, [10, 10, 10, 1]},
{:valid, [10, 10, 10]},
{:invalid, [10, 10, 5, 5, 1]},
{:invalid, [10, 10, 5, 1, 1]},
@neenjaw
neenjaw / roman_numerals.ex
Created Nov 9, 2019
herzrasen roman numerals
View roman_numerals.ex
defmodule RomanNumerals do
@romans [
{1000, "M"},
{900, "CM"},
{500, "D"},
{400, "CD"},
{100, "C"},
{90, "XC"},
{50, "L"},
{40, "XL"},
@neenjaw
neenjaw / go-test-json.sh
Created Nov 8, 2019
Go test --json massaging
View go-test-json.sh
go test --json | \
sed -e 's/^/ /' \
-e '$a\ ]\n]' \
-e '1i[\n [' \
-e '$n; s/$/,/' \
-e '/\(pass\)\|\(fail\)/s/,$/\n ],\n [/'
@neenjaw
neenjaw / say.ex
Last active Nov 8, 2019
Say refactor
View say.ex
# Originally created by @angelikatyborska, https://github.com/angelikatyborska
# Extended by me
defmodule Say do
@min 0
@max 999_999_999_999
@base_cases_map %{
1 => "one",
2 => "two",
View bellman-ford.js
/**
Initiate
distance - stores the distance of the shortest path from source to each vertex.
predecessor - for each vertex, predecessor stores its previous vertex on the path from the source to it.
For the object distance, define each property for the corresponding vertex as Infinity, except for the source,
which should be zero. For the object predecessor, set the property for every vertex as null.
Cycle
Repeatedly check all the edges to see if the stored distance (total weight from the source to a target vertex)
for side u of the edge plus the edge's weight w is smaller than the distance of another vertex u.
View keybase.md

Keybase proof

I hereby claim:

  • I am neenjaw on github.
  • I am tim_austin (https://keybase.io/tim_austin) on keybase.
  • I have a public key whose fingerprint is 00D1 4DDE 6E2C A432 9B1A E432 EAAD C4B6 6EC8 8900

To claim this, I am signing this object:

@neenjaw
neenjaw / install.sh
Last active Aug 20, 2019
Elixir macro to create a pattern matcher of an AST
View install.sh
#!/bin/bash
mix new my_macro_test
rm ./my_macro_test/lib/my_macro_test.ex
cp ./*.ex ./my_macro_test/lib
@neenjaw
neenjaw / feature_ast.txt
Created Aug 19, 2019
ExMentor Situation
View feature_ast.txt
{:@, [],
[
{:spec, [],
[
{:"::", [],
[
{:two_fer, [],
[
{{:., [], [{:__aliases__, [], [:String]}, :t]},
[], []}
You can’t perform that action at this time.