$ rails g model User
belongs_to
has_one
Table of Contents
As configured in my dotfiles.
start new:
tmux
start new with session name:
| const I = x => x | |
| const K = x => y => x | |
| const A = f => x => f (x) | |
| const T = x => f => f (x) | |
| const W = f => x => f (x) (x) | |
| const C = f => y => x => f (x) (y) | |
| const B = f => g => x => f (g (x)) | |
| const S = f => g => x => f (x) (g (x)) | |
| const S_ = f => g => x => f (g (x)) (x) | |
| const S2 = f => g => h => x => f (g (x)) (h (x)) |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
| <canvas id="canvas" width="512" height="256" ></canvas> | |
| <p id="controls"> | |
| <input type="button" id="start_button" value="Start"> | |
| | |
| <input type="button" id="stop_button" value="Stop"> | |
| </p> | |
| <!-- ----------------------------------------------------- --> |
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
| COFFEEC = coffee | |
| SASSC = sass | |
| HANDLEBARSC = handlebars | |
| # Build app package | |
| APPSRC = static/scripts/main.coffee | |
| APPOBJ = ${APPSRC:.coffee=.js} | |
| APPOUT = static/scripts/app.js |
Note:
When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.
If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:
| class console2 { | |
| static image(url: string, size = 100) { | |
| fetch(url) | |
| .then((res) => res.blob()) | |
| .then((blob) => { | |
| const reader = new FileReader(); | |
| reader.onloadend = () => { | |
| const dataUrl = reader.result as string; | |
| const style = [ | |
| 'font-size: 1px;', |