This file contains hidden or 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 TextThing exposing (..) | |
import Html.App as App | |
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import Dom.Scroll | |
import Dom.Size | |
import Task |
This file contains hidden or 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
<snippet> | |
<content><![CDATA[ | |
module Component.${1} exposing (CssClasses(..), css, class, classList) | |
import Css exposing (..) | |
import Css.Namespace exposing (namespace) | |
import Html.CssHelpers | |
styleNamespace : String |
This file contains hidden or 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
<snippet> | |
<content><![CDATA[ | |
module ${1:ComponentName} exposing (..) | |
import Html exposing (..) | |
import Html.App | |
main : Program Never | |
main = |
This file contains hidden or 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
// Brute force way to create infinitely nested lists. | |
// What's a better way to model this and store in db? | |
[ | |
{id: 1, parenId: null}, | |
{id: 2, parenId: null}, | |
{id: 3, parenId: 2}, | |
{id: 4, parenId: 2}, | |
{id: 5, parenId: 1}, | |
{id: 6, parenId: 1}, |
This file contains hidden or 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
let initialState = { | |
one: 'two', | |
three: 'four' | |
} | |
function update1 (state = initialState, action) { | |
switch (action.type) { | |
case SOMETHING: { | |
return state.one = 'changed' |
This file contains hidden or 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
// Need to dock compensation because the width is not accurate | |
// when dock is hidden | |
var HIDDEN_DOCK_COMPENSATION = 4 | |
var halfRight = slate.operation('push', { | |
direction: 'right', | |
style: 'bar-resize:screenSizeX / 2' | |
}) | |
var halfLeft = slate.operation('move', { |
This file contains hidden or 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
// Node streams | |
import through from 'through2' | |
function doSomethingToStream (config) { | |
return through((chunk, enc, next) { | |
next(/* do somethig here */) | |
}) | |
} |
This file contains hidden or 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
test('showing flash message', ({plan, deepEqual, context}) => { | |
plan(2) | |
let {store} = context | |
let results = [] | |
let unsubscribe = store.subscribe(() => results.push(store.getState().ui.flash)) | |
store.dispatch(showFlashMessage({ | |
message: 'message', |
This file contains hidden or 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
var opts = { | |
log: require('./logger'), | |
fs: require('./fs') | |
}; | |
var someCommand( | |
name('something'), | |
use(function (data, flags, options) { | |
options.log('hey!'); | |
options.fs.write('something'); |