Skip to content

Instantly share code, notes, and snippets.

View kylestev's full-sized avatar

Kyle Stevenson kylestev

  • Portland, Oregon
View GitHub Profile
@kylestev
kylestev / JavaScript Injection
Created May 23, 2012 03:50
JavaScript injection into HTML documents using Fiddler
import Fiddler;
class Handlers {
static var injectJs = "<script>alert('I see you enjoy YouTube.')</script>";
static var hostList = new HostList("*.youtube.com");
static function OnBeforeResponse(oSession : Session) {
// Filter to only HTML documents and on the domains we want
if (hostList.ContainsHost(oSession.hostname) && oSession.oResponse.headers.ExistsAndContains("Content-Type", "text/html")) {
oSession.utilDecodeResponse();
@kylestev
kylestev / class166.java
Created November 9, 2017 13:03
s2c packet type enum?
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
@ObfuscatedName("fw")
public class class166 {
@ObfuscatedName("m")
@ObfuscatedSignature(
signature = "Lfw;"
)
@kylestev
kylestev / Manifests.java
Last active May 3, 2016 00:51
Used for grabbing a value associated with a key from a manifest in your classpath.
import java.io.IOException;
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.jar.Manifest;
import java.util.stream.Stream;
/**
* Created by kylestev
@kylestev
kylestev / randomize.py
Last active December 27, 2015 10:19
randomize each word in a string except the first and last letters
import random
import re
def word_stream(sentence):
buff = ''
for c in sentence:
if 'A' <= c <= 'Z' or 'a' <= c <= 'z':
buff += c
else:
if buff:

OSU Course Catalog API

Disclaimer

This is no where near finished and does not follow REST standards.

To get a listing of all subjects you can simply hit http://api.kylestevenson.me/subjects

{
  "subjects": [
@kylestev
kylestev / ip.py
Created May 5, 2013 20:48
Get your IP from MaxMind using the requests and bs4 libraries in Python
from bs4 import BeautifulSoup
from requests import Session
MAXMIND_URL = 'http://www.maxmind.com/en/locate_my_ip'
def get_ip(sesh):
soup = BeautifulSoup(sesh.get(MAXMIND_URL).content)
return soup.find(id='my-ip-address').text
function poke_user(profile_id) {
try {
params = {
'__a': '1',
'uid': profile_id,
'ask_for_confirm': '0',
'pokeback': '0',
'__asyncDialog': '1',
'nctr[_mod]': 'pagelet_timeline_profile_actions',
'fb_dtsg': 'AQCdeZ_I',
@kylestev
kylestev / Capture.java
Created March 12, 2013 03:03
Just a small script for checking the current light level using a webcam. This is similar to what is running on my Raspberry PI in my safe that will send me a text message when the safe is opened.
package com.kylestev.lightlevel;
import com.smaxe.uv.media.core.VideoFrame;
import com.smaxe.uv.na.WebcamFactory;
import com.smaxe.uv.na.webcam.IWebcam;
import java.util.List;
/**
* User: Kyle Stevenson
@kylestev
kylestev / redmine_issues.py
Created February 26, 2013 22:04
Shows all the issues currently assigned to a specified user in Redmine.
import json
import sys
from urllib2 import urlopen
REDMINE_URL = 'https://code.osuosl.org/issues.json?assigned_to_id=%s'
def main():
if len(sys.argv) != 2:
return 'Please add your Redmine user id'
@kylestev
kylestev / compare.py
Created February 18, 2013 19:38
Checks your Facebook friends and records the people that have removed you as a friend since the last check. Technically this is against the API's Terms of Service, so let's just call this a proof of concept.
import sys
import json
def fbquery(token, query):
from urllib import urlencode
from urllib2 import urlopen
from re import sub
query = sub('\ {2,}', ' ', query)
url = 'https://api.facebook.com/method/fql.query?' + urlencode({'query': query, 'access_token': token, 'format': 'json'})