brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
description "Start node.js on reboot" | |
author "Chyld Medford <[email protected]>" | |
# start node | |
start on runlevel [2345] | |
# stop on halt, maintenance or reboot | |
stop on runlevel [016] | |
# start our application with the user `ubuntu` |
app.use(express.cookieParser()); | |
app.use(express.session({ | |
store : new RedisStore({host: 'localhost', port: 6379}), | |
secret: 'change-this-to-a-super-secret-message', | |
cookie: { maxAge: 60 * 60 * 1000 } | |
})); | |
9 var fs = require('fs'); | |
10 var request = require('request'); | |
11 var url = 'https://api:[email protected]/v2/YOURDOMAIN/messages'; | |
12 var post = request.post(url, function(err, response, body){ | |
13 res.send({}); | |
14 }); | |
15 var form = post.form(); | |
16 form.append('from', '[email protected]'); | |
17 form.append('to', '[email protected]'); | |
18 form.append('subject', 'hey from node.js'); |
function initMap(lat, lng, zoom){ | |
var mapOptions = {center: new google.maps.LatLng(lat, lng), zoom: zoom, mapTypeId: google.maps.MapTypeId.ROADMAP}; | |
map = new google.maps.Map(document.getElementById('map'), mapOptions); | |
} | |
function addMarker(location){ | |
var position = new google.maps.LatLng(location.lat, location.lng); | |
var marker = new google.maps.Marker({map:map, position:position, title:location.address}); | |
markers.push(marker); | |
} |
exports.db = function(fn){ | |
MongoClient.connect(mongoUrl, function(err, db) { | |
if(err){throw err;} | |
global.nss = {}; | |
global.nss.db = db; | |
global.nss.db.collection('listings').ensureIndex({'coordinates':'2dsphere'}, function(err, indexName){ | |
console.log('Connected to MongoDB'); | |
fn(); | |
}); | |
}); |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
(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.