Skip to content

Instantly share code, notes, and snippets.

// @flow
/* This allows you to take a directory that contains an application:
```
├── Dockerfile
├── heroku.yml
└── webapp
├── app.py
├── requirements.txt
@jmorrell
jmorrell / a-Repro.md
Last active March 8, 2018 22:02
npm-5-git-devdependency-repro

Local versions on macOS:

❯ npm --version
5.7.1
                                                                                                                                                         
❯ node --version
v8.9.3
curl https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-16/vim.tgz --output vim.tgz
mkdir -p vim/bin && tar xzvf vim.tgz -C vim/bin
export PATH=$PATH:/app/vim/bin
function sad() {
return true;
}
Boolean.prototype.stop = function() {
console.log('Stopping the sad');
}
function beAwesome() {
console.log('Time for awesomeness!');
python -c 'for i in range(0,30): print i*36' | xargs -n 1 -I {} curl "https://www.npmjs.com/browse/depended?offset={}" | grep 'class="name"' | grep -o ">.*<" > list
In the case of an autocomplete, the way we do it is to break it down into two components:
1. A completely dumb component that takes only props. This defines appearance, behavior, etc.
It may have it's own component local state, though that's part of the implementer's job to
decide. If something else anywhere on the page might care, it should be external and passed
in.
Ex: A dropdown component might choose to keep whether or not it's been expanded as local state.
This works, until you need to change something else on the page in response to the dropdown
being open.
import {default as React, PropTypes} from 'react'
const namespace = 'sampleComponent'
export default class SampleComponent extends React.Component {
constructor(props) {
super();
this.state = {value: ''};
}
handleInput(event) {
@jmorrell
jmorrell / app.js
Created May 22, 2014 17:40
React Components
var Component = require('component');
React.renderComponent(<Component name="ben" />, document.body);
@jmorrell
jmorrell / gist:6088975
Created July 26, 2013 13:45
Crazyflie aerogel test
scripts $ node telemetry.js
just connecting & sitting to log some telemetry info...
radio://1/10/250KPS
Using copter at radio://1/10/250KPS
STATE: setup --> connected
starting telemetry
CONSOLE: SYS: Build 31:ba1d111112ad (20
CONSOLE: 13.4) CLEAN
CONSOLE: SYS: I am 0x872036575552864966
@jmorrell
jmorrell / node log
Created July 10, 2013 03:15
johnny-five error
$ node
> var five = require("johnny-five");
undefined
> var board = new five.Board();
1373425923774 Board Connecting...
undefined
> 1373425923777 Serial Found possible serial port /dev/cu.usbmodem1411
1373425923778 Board -> Serialport connected /dev/cu.usbmodem1411
1373425927165 Board <- Serialport ready /dev/cu.usbmodem1411