brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
# ~/code/web:beta_directory$ git checkout master | |
# Switched to branch "master" | |
# ~/code/web:master$ git checkout beta_directory | |
# Switched to branch "beta_directory" |
var http = require('http'); | |
var server = http.createServer(function(req, res) { | |
// console.log(req); // debug dump the request | |
// If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object) | |
var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 | |
console.log("Authorization Header is: ", auth); |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
rule-of-thirds bookmarklet that overlays a rule-of-thirds style grid over all images on a page.
To get the bookmarklet, visit http://bl.ocks.org/4331769
Do the following to be able to use the "RuleOfThirds-localhost" development version of the bookmarklet:
[merge] | |
keepBackup = false | |
tool = p4merge | |
[mergetool "p4merge"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\"" | |
keepTemporaries = false | |
trustExitCode = false | |
keepBackup = false | |
[diff] | |
tool = p4merge |
WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
String response = | |
"HTTP/1.1 200 OK\r\n" | |
"CACHE-CONTROL: max-age=86400\r\n" | |
"DATE: Fri, 15 Apr 2016 04:56:29 GMT\r\n" | |
"EXT:\r\n" | |
"LOCATION: http://" + String(s) + ":80/setup.xml\r\n" | |
"OPT: \"http://schemas.upnp.org/upnp/1/0/\"; ns=01\r\n" | |
"01-NLS: b9200ebb-736d-4b93-bf03-835149d13983\r\n" | |
"SERVER: Unspecified, UPnP/1.0, Unspecified\r\n" | |
"ST: urn:Belkin:device:**\r\n" |