| layout | post | |
|---|---|---|
| title | Hackers Guide to Purdue Computer Engineering | |
| published | false | |
| categories |
|
#Contents ##Introduction
| window.onload = function() { | |
| var s = new io.Socket(null, {port: 3000}); | |
| s.connect(); | |
| s.on('message', function(data) { | |
| if (data['type'] == 'add') { | |
| $("#announcements").append( | |
| '<div id=' + data['id'] +'>' + data['payload'] + '</div>' | |
| ); | |
| } |
| //Good! (well, better at least...) | |
| app.get('/edit', function(req, res){ | |
| var stored_items = []; | |
| //pull some data out of mongo | |
| Announcement.fetch_active().all(function(results) { | |
| for (i in results) { | |
| stored_items.push(results[i].body); | |
| } |
| //Bad! | |
| app.get('/edit', function(req, res){ | |
| var stored_items = []; | |
| //pull some data out of mongo | |
| Announcement.fetch_active().all(function(results) { | |
| for (i in results) { | |
| stored_items.push(results[i].body); | |
| } | |
| }); |
| #!/usr/bin/env python | |
| # MapQuest API Turn-by-turn script | |
| # | |
| # Generates driving directions from a starting location | |
| # to a series of destinations in a CSV, used to print | |
| # maps for volunteers delivering food to the less-fortunate | |
| # | |
| # CSV format - place in a file named `list.csv` | |
| # Name, Street, Zipcode, Phone, Count |
| pygments: true | |
| source: ./_posts | |
| destination: ./blog |
| matt@nigiri:~$ sloccount $GIT_REPO_DIR 2>/dev/null | grep '%' | head -n 1 | cut -d : -f 1 | |
| #doesnt work on javascript since LOC scripts havent been updated since like 2004 |
| export WORKON_HOME=$HOME/.virtualenvs | |
| source /usr/local/bin/virtualenvwrapper.sh | |
| # Automatically activate Git projects' virtual environments based on the | |
| # directory name of the project. Virtual environment name can be overridden | |
| # by placing a .venv file in the project root with a virtualenv name in it | |
| function workon_cwd { | |
| # Check that this is a Git repo | |
| GIT_DIR=`git rev-parse --git-dir 2> /dev/null` | |
| if [ $? == 0 ]; then |
| from argparse import ArgumentParser | |
| import re | |
| from datetime import date | |
| p = ArgumentParser(description='Generate a jeykll blog post template') | |
| p.add_argument('title', help='title of the post, generates slug') | |
| p.add_argument('category', help='category (e.g blog, writeup)') | |
| args = p.parse_args() | |
| template = '''--- |
| layout | post | |
|---|---|---|
| title | Hackers Guide to Purdue Computer Engineering | |
| published | false | |
| categories |
|
#Contents ##Introduction
| GET https://api.github.com/repos/swanson/swanson.github.com/git/blobs/957e6b4efb22fa921d0e6b17a1fbf46788c97ed3 | |
| HTTP/1.1 200 OK | |
| Server: nginx/1.0.4 | |
| Date: Sun, 10 Jul 2011 00:08:16 GMT | |
| Content-Type: application/json | |
| Connection: keep-alive | |
| Status: 200 OK | |
| X-RateLimit-Limit: 5000 | |
| X-RateLimit-Remaining: 4988 |