Skip to content

Instantly share code, notes, and snippets.

View curtiswilkinson's full-sized avatar

Curtis Tate Wilkinson curtiswilkinson

View GitHub Profile
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Http
import Json.Decode as Decode
type alias Model =
module Main exposing (..)
import Html exposing (..)
import Html.Events exposing (onClick)
import Http
import Json.Decode as Decode
main : Program Never Model Msg
main =
@curtiswilkinson
curtiswilkinson / .spacemacs
Last active July 18, 2017 12:25
Spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" ------------------------------------
" Theme
" ------------------------------------
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> released under the WTFPL v2 license, by Gregory Pakosz (@gpakosz)
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color" # colors!
@curtiswilkinson
curtiswilkinson / Component.jsx
Last active March 6, 2017 22:42
Class Component Context Binding
// Binding in Constructor, this is the currently recommended method in the React documentation and what I'm used to using
// It can look kinda bad if you use a lot of them, BUT it does keep the render method clean and avoid repetition of binding
class Component extends React.Component<any, any> {
constructor(props) {
super(props)
this.state = {
bool: false
}
this.handleFunction = this.handleFunction.bind(this)
@curtiswilkinson
curtiswilkinson / test1.js
Last active February 9, 2017 23:15
Testing
import * as sut from './index1'
import * as sinon from 'sinon'
import { expect } from 'chai'
describe('_saveAndProcessPayload', () => {
it('will return a formatted API payload', () => {
const mockPayload = [
{ name: 'name1', value: 'value1' },
{ name: 'name2', value: 'value2' },
]
@curtiswilkinson
curtiswilkinson / function2.js
Created February 9, 2017 23:03
Currying + Partial Application
import * as api from 'whatever'
import * as R from 'ramda'
interface ReturnPayload {
name: string,
value: string
}
export function _saveAndProcessReturn(apiDep, payload) {
const saveReturn: ReturnPayload[] = apiDep.save('Route', payload)
@curtiswilkinson
curtiswilkinson / function1.js
Created February 9, 2017 22:56
example function
import * as api from 'whatever'
interface ReturnPayload {
name: string,
value: string
}
export function saveAndProcessReturn(payload) {
const saveReturn: ReturnPayload[] = api.save('Route', payload)
set -g default-terminal "xterm-256color"
run '~/.tmux/plugins/tpm/tpm'
unbind C-b
set -g prefix C-a
bind C-a send-prefix