I hereby claim:
- I am wmertens on github.
- I am wmertens (https://keybase.io/wmertens) on keybase.
- I have a public key ASA6XQ6RqdgBgVFsOKWY0PV55O0x0hHULlbBfmNNhGbUXwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| import React, {Component, PropTypes} from 'react' | |
| import {Link, Route as OrigRoute, Switch, Redirect, BrowserRouter as Router, withRouter} from 'react-router-dom' | |
| // Subscribes a child to history updates, passing the current location as a prop | |
| // This is needed to work around the React context API not updating all children | |
| // See https://github.com/ReactTraining/react-router/issues/4629#issuecomment-284218493 | |
| export class LocationListener extends Component { | |
| static contextTypes = { | |
| history: PropTypes.object, | |
| } |
| on run | |
| -- Figure out if we want to do the cd (doIt) | |
| -- Figure out what the path is and quote it (myPath) | |
| set doIt to false | |
| try | |
| tell application "Finder" to set doIt to frontmost | |
| set myPath to finder_path() | |
| if myPath is equal to "" then | |
| set doIt to false | |
| else |
| // Based on https://gist.github.com/langpavel/b30f3d507a47713b0c6e89016e4e9eb7 | |
| const serializeDate = value => { | |
| if (value instanceof Date) { | |
| return value.toJSON().slice(0, 10) | |
| } else if (typeof value === 'number') { | |
| return Math.trunc(value) | |
| } else if (typeof value === 'string') { | |
| return (new Date(value)).toJSON().slice(0, 10) | |
| } | |
| return null |
| enum PostStates { DRAFT, PUBLISHED, ARCHIVED } | |
| scalar Date | |
| scalar Html | |
| directive @buildIndex on field | |
| directive @defaultFirst on field | |
| #...etc | |
| type PostContent { | |
| brief: Html @editor(height: 150, wysiwyg: true) | |
| extended: Html @editor(height: 400, wysiwyg: true) |
| const keystone = require('keystone') | |
| keystone.init({ | |
| name: 'myApp', | |
| brand: 'My App', | |
| port: process.env.PORT, | |
| 'ssl port': process.env.SSLPORT, | |
| ssl: 'force', |
We describe a model for client-server processing where the Redux model is used to minimize stateful code. This should allow live-reloading server code, and make it possible to share code (e.g. optimistic updating) between client and server.
| # Auto-vendor-prefixer | |
| # Finds the vendor prefix to use | |
| # MIT license, Author: Wout Mertens | |
| prefix=null | |
| myStyle=document?.head?.style or {} | |
| foundProps={} | |
| newCssProp = (prop) -> | |
| t = foundProps[prop] |
| <?xml version="1.0"?> | |
| <root> | |
| <devicevendordef> | |
| <vendorname>WT</vendorname> | |
| <vendorid>0x000d</vendorid> | |
| </devicevendordef> | |
| <deviceproductdef> | |
| <productname>TB</productname> | |
| <productid>0x0000</productid> |
| # Pure coffeescript React.JS | |
| # Also features "global state manager" | |
| R = React.DOM | |
| N = null | |
| # global state manager | |
| render = null | |
| state = clicks: 0 | |
| count = -> |