This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cookoff" : { | |
"complete" : true, | |
"criteria" : [ { | |
"name" : "Taste" | |
}, { | |
"name" : "Aftertaste" | |
}, { | |
"name" : "Aroma" | |
}, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {BrowserModule} from "@angular/platform-browser"; | |
import {NgModule} from "@angular/core"; | |
import {FormsModule, ReactiveFormsModule} from "@angular/forms"; | |
import {HttpModule} from "@angular/http"; | |
import {NgBootstrapFormValidationModule} from "ng-bootstrap-form-validation"; | |
import {AppComponent} from "./app.component"; | |
import {CUSTOM_ERRORS} from "./custom-errors"; | |
@NgModule({ | |
declarations: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adding this to .bash_profile updates the tab title when the directory changes | |
# can also manually name a tab eg: title FOOBAR | |
function title { | |
export TITLE_OVERRIDDEN=1 | |
PROMPT_COMMAND='' | |
echo -ne "\033]0;"$*"\007" | |
} | |
case "$TERM" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// file should be in ${workspaceRoot}/loaders/ | |
const path = require('path'); | |
webpackConfig = { | |
resolveLoader: { | |
modules: [ | |
'node_modules', | |
path.resolve(__dirname, 'loaders') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal { | |
name: string; | |
} | |
class Dog extends Animal { | |
bark() {}; | |
} | |
class Cat extends Animal { | |
meow() {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const format = (strings, ...values) => { | |
if (values.every(v => typeof v !== "function")) { | |
return strings.reduce((acc, str, i) => values[i] === undefined ? acc + str : acc + str + values[i], "") | |
} | |
return obj => strings.reduce((acc, str, i) => values[i] === undefined ? acc + str : | |
typeof values[i] === "function" ? acc + str + values[i](obj) : acc + str + values[i], "") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useReducer, useContext } from "react"; | |
const defaultState = { | |
todos: [], | |
addTodoInputText: "" | |
}; | |
export const StoreContext = React.createContext([defaultState, () => {}]); | |
export function Store({ children }) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module List | |
( MyList | |
, fromList | |
, toList | |
, myMap | |
, myFilter | |
, myFoldl | |
, myReverse | |
, (+++) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The reducer function looks at each action that comes in | |
// and based on the type generates a new state based on the | |
// previous state and any additional data the action carried | |
const reducer = (state, action) => { | |
switch (action.type) { | |
case "COUNT_INCREMENT": | |
return { | |
...state, | |
count: state.count + 1 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chk :: Eq b => (a -> b) -> a -> b -> Bool | |
-- All arguments are present on the left | |
-- chk fn a b = b == fn a | |
-- get rid of 'b' param on the left by partially applying (==) operator | |
-- chk fn a = (== fn a) | |
-- get rid of 'a' param on the left by composing (==) after fn | |
-- chk fn = (==) . fn |
OlderNewer