Skip to content

Instantly share code, notes, and snippets.

View JonnoFTW's full-sized avatar
⚔️
Fighting off bugs with a sword 🤺

Jonathan Mackenzie JonnoFTW

⚔️
Fighting off bugs with a sword 🤺
View GitHub Profile
from collections import Counter
import re, praw
print "Fetching unimportant words..."
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
c = Counter()
r = praw.Reddit(user_agent='praw')
username = 'username'
print "Logging in as",username
// Quadtree.js usage looks like:
var markers = []; // some array of google map markers
quadTree = new QuadTree(markers);
console.log("Built quadtree with size "+markers.length);
var bounds = map.getBounds();
console.log("New Bounds"+bounds.toString());
// find all points within the viewport bounding rectangle,
// or whatever rectangle you supply
var foundPoints = quadTree.queryRectangle(bounds);
public class CameraSurface extends SurfaceView implements Callback {
private Camera mCamera;
private SurfaceHolder mHolder;
private Context c;
private static final String CNAME = ScanActivity.class.getName();
private PreviewCallback cb;
public CameraPreview(Context context, PreviewCallback cb) {
super(context);
this.c = context;
@JonnoFTW
JonnoFTW / gist:7694727
Created November 28, 2013 16:40
Python sudoku solver.
import heapq
import itertools
nums = set(range(1,10))
class Node:
def __init__(self, grid):
self.children = []
self.grid = grid
self.answered = 0
for i in self.grid: