Skip to content

Instantly share code, notes, and snippets.

@bobobo1618
bobobo1618 / Collocations.py
Created October 5, 2011 07:59
Gets collocations given a list of words.
def lexical_diversity(wordlist):
"""Returns the ration of the number of unique words to the number of words overall as a floating point number
(unique/normal)."""
normal = []
for word in wordlist:
normal.append(word.lower())
# Conversion to a set finds unique words.
return float(len(wordlist))/float(len(set(wordlist)))
def getbigrams(words):
@bobobo1618
bobobo1618 / Derp.html
Created November 18, 2011 13:09
Next page on right arrowkey
<script>
$(document).keydown(function(e){
if (e.keyCode == 39) {
window.location = "<insert URL of next page here>";
}
});
</script>
@bobobo1618
bobobo1618 / meta.yaml
Created January 25, 2012 05:05
YAML Sample
layout: 'post'
allow comments: '1'
allow pings: '1'
author: 'aztecxcore'
basename: 'air_tv'
category: ['Anime, Reviews']
convert breaks: 'markdown'
date: 2011-10-03 11:30:00
primary category: 'Reviews'
status: 'Publish'
@bobobo1618
bobobo1618 / Air_TV.txt
Created January 25, 2012 05:09
Air TV Review
--- yaml
title: 'AIR TV (2005)'
'allow comments': '1'
layout: 'post'
'allow pings': '1'
author: 'aztecxcore'
basename: 'air_tv'
category: ['Anime, Reviews']
'convert breaks': 'markdown'
date: '2011-10-03 11:30:00'
@bobobo1618
bobobo1618 / gist:1833439
Created February 15, 2012 05:12
NPM Log
/home/lucas/.nvm/v0.6.9/bin/docpad -> /home/lucas/.nvm/v0.6.9/lib/node_modules/docpad/bin/docpad
> docpad@3.2.0 install /home/lucas/.nvm/v0.6.9/lib/node_modules/docpad
> coffee ./bin/docpad install
Error: Cannot find module 'request'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
switch(argc) {
case 1:
cout << "s3382003, s3382003@student.rmit.edu.au, Belinda Hester" << endl;
return EXIT_SUCCESS;
@bobobo1618
bobobo1618 / Toaster.md
Created July 25, 2012 09:39
Toaster instructions

Toaster - Toaster Industries T1000 Bread Scorching Device

Getting Started

To prepare your toast optimally, please proceed as follows. We advise you to read these instructions in their entirety before proceeding.

  • Plug in your toaster by inserting the three metal pronged plug attached to the end of the cable that protrudes from the body of the toaster into the power point. Please ensure that the power switch on the power point is switched to the off position to prevent any electrical discharge.
There was some stage where I was someone else and I was watching a meeting between two old people and some form of assassin who was sneaking up on them. This appeared to be in medieval times in an old (but quite large) wooden shack. They were talking about some of their colleagues and some form of plan/conspiracy the group was involved in. The assassin eventually killed them (I was quite scared of this assassin by the way) and then I ran. On my way out (I took a dead end into a cupboard at some stage) out, I encountered a swordsman and an archer who were surprised and I ran past them. They immediately chased me and when they came outside the archer fired an arrow at me. I ran as fast as I could through farmland and such until I got to some sort of town. As I was there, I saw a large, white modern looking house on top of a grass covered hill which was what I was running towards. On my way up I saw lots of people wearing a red and blue uniform and I shouted things like "thief" and "enemy of the king" and the gu
@bobobo1618
bobobo1618 / Down.coffee
Created August 15, 2012 14:41
Tumblr Downloader
fs = require 'fs'
http = require 'http'
xml2js = require 'xml2js'
user = process.argv[process.argv.length-1]
processdata = (rawData, action)->
if rawData.posts? and rawData.posts.post?
posts = rawData.posts
@bobobo1618
bobobo1618 / ThreadRead.py
Created September 8, 2012 08:58
ThreadRead
import MySQLdb
print "Content-Type: text/html\n"
print """\
<html>
<head><title>Thread</title></head>
<body>