Skip to content

Instantly share code, notes, and snippets.

View ChetHarrison's full-sized avatar

Chet Harrison ChetHarrison

View GitHub Profile
@ChetHarrison
ChetHarrison / new.elm
Created November 21, 2016 22:11
First (failed) attempt at adding a keyed node. I am using elm-mdl so I thought I could wrap their textfield component in a keyed div but that didn't solve the problem.
introField : Model -> Int -> String -> Html Msg
introField model index paragraph =
node "div" []
[ ( toString index
, Textfield.render Mdl [ 3, 0, index ] model.mdl
[ Textfield.label <|
"Paragraph " ++
(toString <| index + 1) ++
" of Introduction"
, Textfield.floatingLabel
@ChetHarrison
ChetHarrison / Layout.elm
Last active April 26, 2017 15:02
Using a Recipe in my Layout with elm-mdl
module Layout exposing ( .. )
import Html exposing ( .. )
import Html.App
import Html.Attributes exposing ( .. )
import Material
import Material.Scheme as Scheme
import Material.Layout as Layout
import Material.List as List'
module Recipe exposing ( .. )
import Html exposing ( .. )
import Html.Attributes exposing ( class, id )
import Html.Events exposing ( onClick, onMouseEnter, onMouseLeave )
import Material
import Material.Scheme
import Material.Card as Card
import Material.Options as Options exposing ( cs, css )
@ChetHarrison
ChetHarrison / index.js
Created September 19, 2015 00:50
The fab Sanctuary lib wrapped in the UMD
/* #######
#### ####
#### ### ####
##### ########### sanctuary
######## ######## noun
########### ##### 1 [ mass noun ] refuge from unsafe JavaScript
#### ### ####
#### ####
####### */
@ChetHarrison
ChetHarrison / example.js
Created September 16, 2015 19:44
Maybe Modad Example
'use strict';
import Maybe from 'maybe';
import R from 'ramda';
var person = {
'name' : 'Homer Simpson',
'address' : {
'street' : '123 Fake St.',
'city' : 'Springfield'
@ChetHarrison
ChetHarrison / example-id.js
Created September 15, 2015 03:22
functional fantasy examples
'use strict'
import Id from 'id'
const func = x => x + 2;
const extFunc = x => x.extract( ) * 10;
const intId = Id.of( 1 );
const arrayId = Id.of( [ 1, 2 ] );
const stringId = Id.of( 'stuff' );
const functionId = Id.of( func );
@ChetHarrison
ChetHarrison / .eslintrc
Created March 12, 2015 18:39
eslint runtime config
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"amd": true
},
"ecmaFeatures": {
@ChetHarrison
ChetHarrison / gistbook.json
Created January 21, 2015 04:49
Chester Tester
{"title":"Chester Tester","author":"ChetHarrison","pages":[{"pageName":"","sections":[{"type":"text","source":"This is a new Gistbook."},{"type":"html","source":"<DOCTYPE html>\n <h1>Howdy</h1>\n</DOCTYPE>"},{"type":"css","source":"h1 {\n color: red;\n}"},{"type":"javascript","source":"alert('check');"}]}],"public":true}
'use strict';
var fs = require('fs'),
path = require('path'),
jsToAst = require('./src/parsers/js-to-ast.js'),
https = require('https'),
rawGitScrUrl = 'https://rawgit.com/marionettejs/backbone.marionette/master/src/',
get, srcFileList, options;
@ChetHarrison
ChetHarrison / get-string-at-url.js
Created January 18, 2015 05:44
Node tool to grab contents of url and return it in a string
'use strict';
var fs = require('fs'),
path = require('path'),
jsToAst = require('./src/parsers/js-to-ast.js'),
https = require('https'),
rawGitScrUrl = 'https://rawgit.com/marionettejs/backbone.marionette/master/src/',
get, srcFileList, options;