Skip to content

Instantly share code, notes, and snippets.

@localshred
localshred / keybase.md
Created February 8, 2016 19:25
Keybase github verification

Keybase proof

I hereby claim:

  • I am localshred on github.
  • I am localshred (https://keybase.io/localshred) on keybase.
  • I have a public key whose fingerprint is CBF2 CAFD 44F6 6592 ED7C 15F5 4FB9 71C2 60DF 216D

To claim this, I am signing this object:

defmodule MySupervisor do
@moduledoc """
Supervisor to manage MyWorker.
"""
use Supervisor
def start_link do
Supervisor.start_link(__MODULE__, [], name: __MODULE__)
end
@localshred
localshred / Makefile
Last active January 30, 2016 14:13
Makefile useful in an Elixir project that uses watchman-make for fun and profit.
SHA = "HEAD"
WATCH_TARGET = "test"
ifdef sha
SHA = $(sha)
endif
ifdef t
WATCH_TARGET = $(t)
endif
$ tree test
test
├── coordinator_test.exs
├── data
│   ├── post_items.json
│   ├── postitems.1.json
│   ├── postitems.json
│   ├── test_cases
│   │   ├── big
│   │   │   ├── ferrari.done.json
module Foo where
-- ...
type Action =
MetaKeyDown Bool
-- ...
@localshred
localshred / follow-the-mouse.elm
Created October 29, 2015 05:04
Watch the eyes follow the mouse.
module FollowTheMouse where
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Mouse
import Signal exposing ((<~), (~))
import Window
type alias Viewport =
@localshred
localshred / TicTacToe-drawing-board.elm
Created October 12, 2015 04:15
TicTacToe - I CAN DRAW STUFFZZZZZ
module TicTacToe where
import Graphics.Element exposing (Element, centered)
import Graphics.Collage exposing (Form, toForm, collage, moveY, move, outlined, filled, dashed, square, circle, solid)
import Color exposing (yellow, gray, blue, green, orange, red)
import Text exposing (fromString)
import Window
import Signal exposing ((<~))
import Array exposing (initialize, repeat, toList)
@localshred
localshred / TicTacToe-broken.elm
Last active October 12, 2015 15:03
When I comment out line 73 the program compiles. The program isn't complete of course, struggling to figure out where/how this compile error is happening. Don't judge me, just help me.
module TicTacToe where
import Graphics.Element exposing (Element, centered)
import Graphics.Collage exposing (Form, toForm, collage, moveY, move, outlined, dashed, square)
import Color exposing (yellow, gray, blue, green, orange, red)
import Text exposing (fromString)
import Window
import Signal exposing ((<~))
import Array exposing (initialize, repeat, toList)
@localshred
localshred / higher_order_list_handling.rb
Last active August 29, 2015 14:21
Handling lists with higher-order functions
require "awesome_print"
##
# The term "higher-order" is meant to describe a function that
# takes other functions as arguments, produces a function as a return value,
# or both.
#
# ----> tl;dr use higher-order functions for working with lists as opposed to general "for loop" iteration.
#