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 typeof {Foo} from './foo' | |
class Bar extends Component { | |
props: { | |
foolike: Foo | |
} | |
render (){....} | |
} |
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
Show hidden characters
{ | |
"presets": ["es2015", "react"] | |
} |
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 MarkdownIt from 'markdown-it'; | |
import {convertFromRaw} from 'draft-js'; | |
import util from 'util'; | |
import _ from 'lodash'; | |
const flog = (whatever) => { | |
console.log(util.inspect(whatever, {depth: null, colors: true})); | |
}; |
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
/** | |
* add .default to requires for 'stores/index' that don't already have them. | |
* | |
* this comes up because babel6 Does The Right Thing with es6 exports and | |
* commonjs requires now need to play by the rules of the es6 exported modules | |
* and specify the default argument. see more: | |
* https://medium.com/@kentcdodds/misunderstanding-es6-modules-upgrading-babel-tears-and-a-solution-ad2d5ab93ce0#.tjlvbfd4x | |
* | |
*/ | |
export default function transformer(file, api) { |
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
/** | |
* jsx-require-codeshift changes all import/require calls for .jsx files to their root files | |
* | |
* this is not a very complicated jscodeshift transform, but the more the merrier imo, since there | |
* aren't very many out there to peek at. (it could probably be satisfied with a not-crazy regex). | |
* | |
* What this does is converts calls like `import Foo from 'foo.jsx';` to `import Foo from 'foo';` | |
* and similarly, it also converts require calls for jsx files to their extensionless versions. | |
* | |
*/ |
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
var Nest = (classlist) => { | |
// classlist = 'foo bar baz' | |
let classes = classlist.split(' '); | |
classes.reverse(); | |
let nestReducer = (prev, current) => <div className={current}>{prev}</div>; | |
return (el) => (props) => classes.reduce(nestReducer, el) | |
} | |
var Hello = React.createClass({ |
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
Verifying that +nsfmc is my blockchain ID. https://onename.com/nsfmc |
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, {Component} from 'react' | |
export default class Force extends Component { | |
componentDidMount () { | |
this.refs.parent.addEventListener('webkitmouseforcewillbegin', | |
this.handleForceWillBegin.bind(this)) | |
this.refs.parent.addEventListener('webkitmouseforcedown', | |
this.handleForceDown.bind(this)) | |
this.refs.parent.addEventListener('webkitmouseforceup', | |
this.handleForceUp.bind(this)) |
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 argparse | |
import random | |
def dicenumber(): | |
"""return a 5-digit number suitable for diceware | |
the 5-digit integer contains only the digits 1-6 | |
""" | |
return int(''.join([str(random.randrange(1, 7)) for x in range(5)])) |
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 argparse | |
import av # pip install av | |
import os.path | |
import subprocess | |
def popen_results(args): | |
proc = subprocess.Popen(args, stdout=subprocess.PIPE) | |
return proc.communicate()[0] |