Skip to content

Instantly share code, notes, and snippets.

View Sourceless's full-sized avatar

Laurence Pakenham-Smith Sourceless

View GitHub Profile
@Sourceless
Sourceless / gist:4a3f365be136a7fb9488
Created May 11, 2015 19:59
Verifying I am +sourceless on my passcard. https://onename.com/sourceless
Verifying I am +sourceless on my passcard. https://onename.com/sourceless
@Sourceless
Sourceless / bar_crawl.py
Created May 29, 2015 18:25
UoY CompSci Bar Craw 2015, Code Review
my_name = # Oh dear, this is a SyntaxError!
my_year = # Same here! And these variables are never used!
crawl = [
"Glasshouse",
"Lowther",
"Yates's",
"Parish",
"Society",
@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?

@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
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:5875973
Created June 27, 2013 12:15
Simple Twilio API send-a-text script
from twilio.rest import TwilioRestClient
import sys
account_sid = 'your-account-sid'
auth_token = 'your-auth-token'
client = TwilioRestClient(account_sid, auth_token)
message = client.sms.messages.create(body=sys.argv[1],
to="your-number",
from_="your-twilio-number")
@Sourceless
Sourceless / gist:6041228
Created July 19, 2013 18:17
Simple text-me twilio script
from twilio.rest import TwilioRestClient
import sys
account_sid = 'my-account-sid'
auth_token = 'my-auth-token'
client = TwilioRestClient(account_sid, auth_token)
message = client.sms.messages.create(body=sys.argv[1],
to="my-number",
from_="twilio-number")
@Sourceless
Sourceless / gist:6041235
Created July 19, 2013 18:18
Simple send-me-a-text script
from twilio.rest import TwilioRestClient
import sys
account_sid = 'my-account-sid'
auth_token = 'my-auth-token'
client = TwilioRestClient(account_sid, auth_token)
message = client.sms.messages.create(body=sys.argv[1],
to="my-number",
from_="twilio-number")
@Sourceless
Sourceless / gist:6065182
Last active December 20, 2015 03:39
Stupidly bad python function importy thing
# Disclaimer: this is terrible and bad.
# Directory structure:
# bin/
# fragman/
# __init__.py
# fragments/
# __init__.py
# some_awesome_func.py
#
#
@Sourceless
Sourceless / ohaiserv.py
Created July 24, 2013 14:05
Server for Hayashi's OHAI protocol
import BaseHTTPServer
class OhaiHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200, 'OHAI')
self.end_headers()
self.wfile.write('OHAI')
if __name__ == '__main__':