Started from the Bottom
CascadiaJS 2014 Talk
Slides: https://speakerdeck.com/jasonrhodes/started-from-the-bottom
Links etc.
function masala(divisor) { | |
return function (dividend) { | |
return dividend / divisor; | |
}; | |
} | |
var naan = masala(0); |
Started from the Bottom
CascadiaJS 2014 Talk
Slides: https://speakerdeck.com/jasonrhodes/started-from-the-bottom
Links etc.
#!/bin/sh | |
# Store git files in a different directory than the repo | |
git --work-tree=/var/www/meatspace-markov-memeify --git-dir=/var/repos/meatspace-markov-memeify/app.git checkout -f | |
# Install npm deps | |
cd /var/www/meatspace-markov-memeify && npm install | |
# If index.js is running, restart--otherwise start! | |
forever restart --spinSleepTime 10000 --minUptime 1000 /var/www/meatspace-markov-memeify/index.js --port=8000 || forever start --spinSleepTime 10000 --minUptime 1000 /var/www/meatspace-markov-memeify/index.js --port=8000 |
DOM events bubble up through the DOM tree and register against every element up to the top. The object passed to the listener (call it e
for example) will have the e.target
property, which was the element that was interacted with directly ("clicked", etc.) and the e.currentTarget
property, which is the element that was listening when this event listener caught the event.
e.stopPropagation()
will keep the event from continuing to bubble up the DOM tree.
You will need:
If you don't have an account, get a free one at http://github.com (it's not NECESSARY but we're going to use it for discussions and making the coursework better!)
Go to http://nodejs.org and follow the installation instructions, usually just clicking the big Install button.
console.clear(); | |
var twitter = require('twitter-text'); | |
var linked = []; | |
var body = document.body; | |
linked.push(twitter.autoLink("http://www.monoprice.com/Product?c_id=108&cp_id=10828&cs_id=1082806&p_id=9744&seq=1&format=2")); | |
linked.push(twitter.autoLink("http://google.com")); |
var twitter = require('twitter-text'); | |
var linked = []; | |
var linkify = function (text, options) { | |
var entities = twitter.extractEntitiesWithIndices(text, { extractUrlsWithoutProtocol: true }); | |
return twitter.autoLinkEntities(text, entities, options); | |
}; | |
linked.push(linkify("http://www.monoprice.com/Product?c_id=108&cp_id=10828&cs_id=1082806&p_id=9744&seq=1&format=2")); |
# In ~/.bash_profile or ~/.profile, whichever you use | |
alias gut="git" | |
# In ~/.gitconfig | |
[alias] | |
punch = push | |
# Or maybe more acccurately | |
[alias] | |
punch = push -f |