- docs
- JSX produces React "elements" via React.createElement()
- wrap JSX in parens to get multiple lines
- element != component
- ok to have multiple root nodes
- React elements are immutable
- components are like functions. They accept arbitrary inputs (called "props") and return React elements describing what should appear on the screen.
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
// assume <input id="files" type="file" multiple/> | |
var files = document.getElementById('files'); | |
files.addEventListener('change', processFiles, false); | |
function processFiles() { | |
readFiles(this.files, upload); | |
} | |
function readFiles(files, cb) { | |
var payloads = []; |
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
// pkg: mysql | |
// https://github.com/mysqljs/mysql#performing-queries | |
var mysql = require('mysql'), | |
connection = mysql.createConnection({ | |
host:'localhost', | |
user:'bixa', | |
password:'pwd', | |
database:'foo' | |
}); |
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
# cd from ls | |
cd `ls | grep bengt` | |
# ls by mtime | |
ls -t | |
# page through a file | |
less filename | |
# processes | |
top | |
ps -aux | |
# write file |
http://blog.smalleycreative.com/linux/setup-a-headless-raspberry-pi-with-raspbian-jessie-on-os-x/
- download raspian lite 1.3G (no GIU pkgs)
- extract
- put empty ssh file in there somewhere
- sudo
dd
.. to write to SD card - plug in power and ethernet to router
- find pi:s LAN IP
- ssh (pi:raspberry)
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
// from underscore.js | |
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// [wait] milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounceOG(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { |
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
// data is an array | |
function unique(data) { | |
return data.reduce(function(base, item){ | |
if (base.indexOf(item) < 0 ) { | |
base.push(item); | |
} | |
return base | |
}, []) | |
} |
https://support.google.com/mail/answer/6594?co=GENIE.Platform%3DDesktop&hl=en
- navigate arrows
- open thread RETURN
- new e-mail c
- search /