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
// Just screwing around | |
function exclaim(message = '') { | |
return message + '!'; | |
} | |
function append(src = '', tgt = ''){ | |
return src + tgt; | |
} |
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
# diff | |
# Betaflight / BETAFLIGHTF3 3.1.7 Apr 3 2017 / 21:43:25 (e1c4b5c) | |
feature -TELEMETRY | |
feature -BLACKBOX | |
feature AIRMODE | |
beeper -GYRO_CALIBRATED | |
beeper -RX_LOST | |
beeper -RX_LOST_LANDING | |
beeper -DISARMING |
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
// Pure message maker | |
var messageMakerCurried = R.curry(function(parens, concat, singleMsg = {}) { | |
var {name, message, date} = singleMsg; | |
var nameTag = concat(name, ': '); | |
var dateTag = parens(date); | |
return concat( | |
concat(nameTag, message), | |
concat(' ', dateTag) | |
); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/momentjs/2.10.6/moment-with-locales.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/ramda/0.18.0/ramda.min.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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 vimBinding = document.createElement('script'); | |
vimBinding.setAttribute('src','https://raw.github.com/marijnh/CodeMirror/master/keymap/vim.js'); | |
var mirrors = document.querySelectorAll('.CodeMirror'); | |
// browser support for onload may be iffy ... | |
vimBinding.onload = function () { | |
Array.prototype.forEach.call(mirrors, function (instance){ | |
instance.CodeMirror.setOption('keyMap','vim'); |
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 elements = ['foo', 'bar', 'baz'] | |
for(i=0; i < elements.length; i++){ | |
elements[i].setClick(function(){ | |
alert(i); | |
}); | |
} | |
elements[0].click(); // what happens? |
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
find . -type f -exec sed -i -e 's%../app/%./%g' {} \; | |
find . -type f -exec sed -i -e 's%../build/%./views/%g' {} \; | |
find . -type f -exec sed -i '' -e 's%this.getDOMNode()%ReactDOM.findDOMNode(this)%g' {} \; | |
// osx sed -i expects an extension | |
// Illegal command try export LANG=C |
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
$.getJSON('http://rs.hankyates.com:3000/content', function(data) { | |
data.forEach(function (tab, index){ | |
console.log(tab); | |
$('body').append('<div>' + tab.name + '</div>'); | |
}); | |
}); |
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 wat = React.createClass({ | |
render: function() { | |
return <div className="wat" onClick={function() {console.log('hi')}}/> | |
} | |
}); | |
ReactTestUtils.renderIntoDocument(<wat/>); | |
var huh = ReactTestUtils.scryRenderedDOMComponentsWithTag(wat, 'div'); | |
ReactTestUtils.Simulate.click(huh); | |
// Error: InstanceHandle not injected before use! |
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
function oldestLivingParent(people) { | |
var livingParents = {}; | |
var sortedByAge = []; | |
var oldestLivingParent = false; | |
var isDead = function(p) { | |
return !person.age; | |
}; | |
var isParent = function(p) { | |
return !!livingParent[p.name]; | |
}; |
NewerOlder