Skip to content

Instantly share code, notes, and snippets.

View kylestev's full-sized avatar

Kyle Stevenson kylestev

  • Portland, Oregon
View GitHub Profile

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'})
@kylestev
kylestev / gist:4191441
Created December 2, 2012 22:53
This is for acquiring the "OrderedFriends" list that is rumored to tell you who visits your profile the most. This is more likely fiction than fact, though.
function getScriptIndex() {
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].innerText.indexOf("OrderedFriends") > -1) {
return i;
}
}
return -1;
}
@kylestev
kylestev / pandora.js
Created November 16, 2012 20:31
Pandora functions
function clickButton(className, index) {
var buttons = document.getElementsByClassName(className);
console.log(buttons);
if (index < buttons.length) {
buttons[index].click();
}
}
function getCurrentTrack() {
@kylestev
kylestev / remove.py
Last active October 5, 2015 19:08
Wrote this to get rid of an extortion virus. Might expand it more in the future. https://www.virustotal.com/file/7dcf381565eeb4b7ac6b20fd3911a44580aa9e1a0b9b6d078e2d7819ac837e2b/analysis/
import os
import datetime
appdata = os.environ['APPDATA']
log_dir = appdata + '\\dclogs\\'
local_dir = appdata + '\\..\\Local\\'
exes = [local_dir + 'Java.exe', local_dir + 'wmpnet32.exe', local_dir + 'Microsoft\\Windows\\Start Menu\\Programs\\Startup\\WinUpdate.exe']
found = false
print startup
@kylestev
kylestev / Robot C Maze Logic
Created May 30, 2012 17:00
Program used for my high school team's robot
#pragma config(Hubs, S4, HTMotor, none, none, none)
#pragma config(Sensor, S2, sonar, sensorSONAR)
#pragma config(Sensor, S3, touch, sensorTouch)
#pragma config(Motor, mtr_S4_C1_1, motorD, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S4_C1_2, motorE, tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
void move(int motorDPower, int motorEPower, int millis) {
motor[motorD] = motorDPower;
motor[motorE] = motorEPower;