Skip to content

Instantly share code, notes, and snippets.

View nqthqn's full-sized avatar
🍐
pear programming

Nate nqthqn

🍐
pear programming
View GitHub Profile
@nqthqn
nqthqn / Main.elm
Last active August 29, 2017 23:57
beginnerProgram boilerplate
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
type alias Model = Int
type Msg = NoOp
@nqthqn
nqthqn / elm error
Created June 22, 2017 19:25
kapeesh this
-- UNBOUND TYPE VARIABLES ---------------------------------------- Messaging.elm
Type `Msg` must declare its use of type variable a
12|>type Msg
13|> = MessagesResp (WebData a)
You probably need to change the declaration like this:
type Msg a = ...
@nqthqn
nqthqn / provision.sh
Created May 3, 2017 16:52
WIP: Simple script used for provisioning remote servers
# cat ~/.ssh/id_rsa.pub | ssh root@$1 'cat >> .ssh/authorized_keys'
# ssh-copy-id root@$1
ssh root@$1 'curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
cat ~/.vimrc | ssh root@$1 'cat > .vimrc'
cat ~/.tmux.conf | ssh root@$1 'cat > .tmux.conf'
@nqthqn
nqthqn / gamedata.md
Last active March 18, 2017 00:15
here ya go, daaaaave!

note

  • 300000ms = 5 minute session duration (durSession)
  • You can derive these or I'll get you the data:
description = I will get these from Sonja
fixImagePath = "" or "img/x.png"
name = "Stop Signal"
slug = "stopsignal"
icon = "stopsignal.png
@nqthqn
nqthqn / ideas.md
Created March 17, 2017 19:48
elm pair programming projects

1

Recreate the rainbow: http://codepen.io/terabaud/pen/GWvJem

c = a.getContext("2d")
w = a.width = (innerWidth/30)|0
h = a.height = (innerHeight/30)|0
z = 0
function L(t){
	with(Math)
 for(y0=h;y0--;)
@nqthqn
nqthqn / Decoder.elm
Created March 14, 2017 02:21
swagger.json -> Decoder.elm
module Decoder exposing (..)
import Json.Decode exposing (Decoder, string, int, float, dict, list, bool, map, value, decodeValue, decodeString)
import Json.Decode.Pipeline exposing (decode, required, optional, hardcoded)
maybe : String -> Decoder a -> Decoder (Maybe a -> b) -> Decoder b
maybe name decoder =
optional name (map Just decoder) Nothing
@nqthqn
nqthqn / love.py
Created March 14, 2017 01:03
i wrote this for my girlfriend (Mon, Mar 19, 2012 at 9:23 PM) now she is my wife.
# This is a small program for sweet pea. Lala, I love you a lot.
secret = ['o', 'y', ' ', 'u', 'r', 'a', ' ', 'e', 'y', 'm', 'd', ' ', 'r', 'a', 'e', 'j', 'l', 'e', 'n', 'i']
kiss = ""
for love in range(len(secret)):
if love % 2:
kiss += secret[love]
kiss += secret[love-1]
@nqthqn
nqthqn / elm.md
Last active March 14, 2017 05:27
If you get bored of reading, watch some videos, if you start to tune out, do some more reading, if you feel unproductive, write some Elm. And if you need some inspiration; watch a talk. Repeat ad nauseum.
@nqthqn
nqthqn / learn-elm.md
Created December 26, 2016 19:34
Guide to learning Elm

Guide to learning Elm

Thank the creator of Elm and BDFL, Evan Czaplicki.

I would highly recommend reading the guide and writing elm code before watching any videos.

  • Read the Guide. This is a gitbook by the creator of Elm
  • Try Elm out in the browser. (Hint - try the stuff from the book)
  • Watch a video series to remind yourself of the concepts.
  • Complete the Elm for beginners course over the weekend
@nqthqn
nqthqn / yode.sh
Last active November 7, 2016 17:37
install node and yarn on ubuntu server
#!/bin/bash
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - &&
sudo apt-get install -y nodejs &&
# Install yarn
sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg &&
echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list &&
sudo apt-get update && sudo apt-get install yarn &&