Skip to content

Instantly share code, notes, and snippets.

View Sourceless's full-sized avatar

Laurence Pakenham-Smith Sourceless

View GitHub Profile
class cons:
"""A LISP-like cons cell, composed of two items."""
def __init__(self, car, cdr=None):
self.car = car
self.cdr = cdr
def __repr__(self):
return "({car}, {cdr})".format(car=self.car, cdr=self.cdr)
@Sourceless
Sourceless / gist:4588242
Last active December 11, 2015 10:38
Get frequencies of words from the comments of n subreddit pages. Most of the variables you may want to change are in main(). It produces a reddit markdown table to console of the 200 most common words, and outputs a raw dump of all words. Rate limited to under 30 requests/second. If anyone wants to play with this, or take it on, it needs a user …
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Author: github.com/Sourceless
from urllib2 import urlopen, HTTPError, URLError
from socket import timeout
from time import sleep
from collections import Counter
import json
@Sourceless
Sourceless / 1-interp.md
Created September 24, 2012 22:01
Interpreting the Web

The Status Quo

The front end of any web system these days is pretty easy to describe; it boils down to HTML, CSS, and JavaScript. Yes, there are languages that compile to HTML, CSS and JavaScript (Haml, SCSS, LESS, CoffeeScript, to name a few examples), but eventually, we always end up with some variation of this orthodox trinity.

There are issues with these technologies, as with every technology. I'm not saying there is anything wrong with what we do now (although, a lot of people will point out that there clearly is), but maybe we're missing something.

Variety isn't a bad thing

Why is it we are forced in to this strict three-language system? The entire web has grown and these technologies have taken the limelight, affirming their place in the top spot. But this is the thing. They're the only technologies capable of running straight on the browser, without modifications, of course. So why don't we take a step back?