Skip to content

Instantly share code, notes, and snippets.

View wbills's full-sized avatar

Wayne Bills wbills

  • Ookla
  • Memphis, TN
View GitHub Profile
@wbills
wbills / shared_games.py
Created May 4, 2017 14:40
steam common games
import sys
import steamapi #https://github.com/smiley/steamapi
user_url=sys.argv[1]
api_key = sys.argv[2]
steamapi.core.APIConnection(api_key=api_key, validate_key=True)
u = steamapi.user.SteamUser(userurl=user_url)
friends = u.friends
friends.append(u)
import pydoc
import warnings
import subprocess
#pip install pylyrics
from PyLyrics import *
#bs4 warns about the default parser used in pylyrics, mucks up the output
warnings.filterwarnings("ignore", category=UserWarning, module='bs4')
@wbills
wbills / LocationChanger.plist
Last active May 29, 2018 09:46
Execute script in OSX when WiFi connects
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>locationchanger</string>
<key>ProgramArguments</key>
<array>
@wbills
wbills / circle_pack_example.java
Last active July 26, 2016 05:10
hexagonal circle packing
//wrote this for more efficient scanning of nearby pokemon,
//gets centroids for 7 minimally overlapping circles in a hexagon
//shape around an origin point
//to get a bigger area, just recurse this and de-dupe returned centroids
//for each pass
//this was in java for android, but python code is nearly identical
public static List<LatLng> pointsToScan(LatLng origin) {
double origin_lat = origin.latitude;
double origin_lng = origin.longitude;
@wbills
wbills / neighbor_test.py
Last active July 19, 2016 04:57
test script for determining neighbor cell ids to send to pokemon go api for location requests
import sys
import math
from s2sphere import CellId, LatLng, LatLngRect, Cell
def getNeighbors():
origin = CellId.from_lat_lng(LatLng.from_degrees(FLOAT_LAT, FLOAT_LONG)).parent(15)
walk = [origin.id()]
#get the 8 neighboring cells
@wbills
wbills / README.md
Last active July 19, 2016 01:42
mitmproxy script to get gyms, pokestops, spawns, etc
@wbills
wbills / rails_cookie_decryptor.py
Created July 15, 2015 07:51
Code to decrypt Rails 4.0+ cookies in python