Skip to content

Instantly share code, notes, and snippets.

View ianonavy's full-sized avatar

I. A. Naval ianonavy

View GitHub Profile
@ianonavy
ianonavy / dictionary.txt
Created February 5, 2012 22:00
Scramble with Friends Solver. Dictionary from http://code.google.com/p/dotnetperls-controls/downloads/detail?name=enable1.txt&can=2&q= Uses a depth-first search with a tier.
This file has been truncated, but you can view the full file.
aa
aah
aahed
aahing
aahs
aal
aalii
aaliis
aals
aardvark
@ianonavy
ianonavy / demo
Created July 26, 2012 02:45
Localhost Demo
#!/bin/bash
#
# Localhost Demo
#
# Script to create a tunnel on a remote server. Be sure to configure it to use
# your server's SSH information. You can use this script to temporarily showcase
# a local Web server to the Internet. All you need is a domain and a VPS with
# nginx (or similar software) configured to proxy REMOTE_PORT (see
# configurations) to port 80.
#
@ianonavy
ianonavy / wdr_top.py
Created August 9, 2012 01:33
This simple Python script shows the top contributing members of the online community, webdevRefinery. It compiles a list of members with the highest post counts and sorts them by how high their reputations are in proportion to their post counts.
#!/usr/bin/env python
""" wdR Top Contributor List
This simple Python script shows the top contributing members of the online
community, webdevRefinery. It compiles a list of members with the highest post
counts and sorts them by how high their reputations are in proportion to their
post counts.
Author: ianonavy <ian@ianonavy.com>
@ianonavy
ianonavy / daemon.py
Created August 14, 2012 15:42
Simple daemon that waits for a screenshot to be saved into a folder and automatically uploads it to a remote server. When that's done, it copies the URL into the user's clipboard. Very similar to CloudApp and Droplr, but it runs on Linux.
#!/usr/bin/env python
import sys, os, time, atexit
from signal import SIGTERM
class Daemon:
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
@ianonavy
ianonavy / nexus7-setup-wifi.sh
Created August 29, 2012 14:06
Nexus 7 Setup Wi-Fi: a simple script I wrote to help set up the Nexus 7 device for my university's wireless network. For privacy's sake, I've removed all the parts specifically pertaining to the university. This code is public domain, so modify it as need
#!/bin/bash
#
# Nexus 7 Setup Wi-fi
#
# Simple script to set up a Nexus 7 for a WPA2-Enterprise Wireless network
# with 802.1x authentication, which is broken in Android Jelly Bean. It
# relies on rooting the device.
#
# This script is a work in progress. I am not responsible for any issues
# that arise if you run this script with your device. Use at your own
@ianonavy
ianonavy / config.txt
Created August 29, 2012 14:11
I wrote this script in high school to facilitate the reading of my English textbooks. It splits a text up into individual sentences and flashes them one at a time based on how fast you can read (in words per minute).
Title:
Tartuffe
Filename:
tartuffe.txt
Speed (in words per minute):
600
Saved books:
Title:
/*
Generates a perfect solution to http://www.loper-os.org/bad-at-entropy/manmach.html.
Naive algorithm: Maintain array of correct solution so far. Repeat '1' adding each to the solution until the machine scores. When it scores, save the solution, reset, and re-enter the solution up until right before it fails. Toggle between '1' and '0' and continue repeating until the machine scores. Do this until the solution array is size n.
First 1000 digits:
111110000111100001001110111100000101001101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101000111010001110100011101
@ianonavy
ianonavy / decorators.py
Last active August 29, 2015 14:03
Memoize to File
def memoize_to_file(func=None, **options):
"""Wraps a function definition so that if the function is ever
called with the same arguments twice, the results are pulled from
a cache stored in a file. The filename is specified when decorating
the memoized function. Iterable objects like dicts, lists or
pandas DataFrames are cast to a tuple before being hashed, and
everything else uses the object's __repr__ definition.
Usage:
@ianonavy
ianonavy / hanto.py
Last active August 29, 2015 14:07
Hanto Tournament Runner
from __future__ import division
import argparse
import itertools
import sys
import threading
from math import pi, cos, sin, sqrt
import Tkinter as tk
from PIL import Image, ImageTk
@ianonavy
ianonavy / keybase.md
Created March 26, 2015 21:12
keybase.md

Keybase proof

I hereby claim:

  • I am ianonavy on github.
  • I am ianonavy (https://keybase.io/ianonavy) on keybase.
  • I have a public key whose fingerprint is 88CC 1897 CF89 A3AB F5E8 5F95 A9D4 05F4 8C84 74B3

To claim this, I am signing this object: