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
import simplejson | |
import urllib | |
import PyRSS2Gen | |
hn_url = "http://news.ycombinator.com/" | |
#Run the YQL and get the JSON back | |
yql_url = "http://query.yahooapis.com/v1/public/yql?q=%20select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fnews.ycombinator.com%2Fnewest%22%20and%20xpath%3D'%2F%2Ftd%5B%40class%3D%22title%22%5D%2Fa'&format=json&callback=" | |
yql_results = urllib.urlopen(yql_url) #The query will return JSON | |
yql_json = simplejson.load(yql_results) |
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
#!/bin/bash | |
#Declare array | |
declare -a ARRAY | |
#Open file for reading to array | |
exec 10<urls.txt | |
let count=0 | |
while read LINE <&10; do | |
url=$LINE | |
hiturl="http://localhost:8000${LINE}" |
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
" Show syntax coloring | |
syntax enable | |
set tabstop=4 | |
set autoindent | |
set hls | |
colorscheme desert | |
" Show line numbers | |
" set number |
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
#!/bin/bash | |
LOCAL_BASHRC_VER="1.7.3" | |
# | |
# !!! DO NOT FORGET TO UPDATE LOCAL_BASHRC_VER WHEN COMMITTING CHANGES !!! | |
# | |
# $Id: .bashrc 432 2006-09-12 19:15:05Z bklang $ | |
# v1.7.3 Add missing 1.7.3 version tag and alkaloiddev network | |
# Rev 420: This one goes out to Bryan | |
# Mute perl warnings (deja-vu?) | |
# Reset term color after printing PATH warning |
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
Traceback (most recent call last): | |
File "/usr/local/bin/virtualenv", line 8, in <module> | |
load_entry_point('virtualenv==1.4.3', 'console_scripts', 'virtualenv')() | |
File "/Library/Python/2.6/site-packages/virtualenv-1.4.3-py2.6.egg/virtualenv.py", line 528, in main | |
use_distribute=options.use_distribute) | |
File "/Library/Python/2.6/site-packages/virtualenv-1.4.3-py2.6.egg/virtualenv.py", line 611, in create_environment | |
site_packages=site_packages, clear=clear)) | |
File "/Library/Python/2.6/site-packages/virtualenv-1.4.3-py2.6.egg/virtualenv.py", line 689, in install_python | |
for fn in os.listdir(stdlib_dir): | |
OSError: [Errno 13] Permission denied: '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages' |
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
" Cobbled together from the internet (mostly from | |
" rtomayko's dotfiles on github: | |
" http://github.com/rtomayko/dotfiles/blob/rtomayko/.vimrc) | |
" ---------------------------------------------------------- | |
" GENERAL | |
" ---------------------------------------------------------- | |
set nocompatible " No vi compatibility | |
set history=1000 " lots of history |
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
vagrant@precise64:~$ ab -k -c 5 -n 100 http://10.201.240.68:3002/slideshows | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 10.201.240.68 (be patient).....done | |
Server Software: | |
Server Hostname: 10.201.240.68 |
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
vagrant@precise64:~$ ab -k -c 5 -n 100 http://10.201.240.68:3002/slideshows | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 10.201.240.68 (be patient).....done | |
Server Software: | |
Server Hostname: 10.201.240.68 |
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
// Expecting something like /photos/bulk?ids=123,456 | |
app.get('/photos/bulk', function(req, res, next) { | |
var ids = req.query.ids.split(','); | |
Photo.find({_id : {$in: ids}}, function(err, photos) { | |
if(err) { | |
next(err) | |
} else if (photos) { | |
var wrapped = {}; | |
for(var i = 0; i < photos.length; i++) { | |
var p = photos[i]; |
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
# Title | |
Hello World | |
# Picture | |
media: undefined | |
# Objective | |
undefined | |
# Duration | |
undefined | |
# Age Group | |
undefined |
OlderNewer