Skip to content

Instantly share code, notes, and snippets.

View WanaByte's full-sized avatar

Kyle Wanamaker WanaByte

  • Google
  • San Francisco, CA
View GitHub Profile
import urlparse
import oauth2 as oauth
consumer_key = raw_input('Consumer key?')
consumer_key = consumer_key.strip()
consumer_secret = raw_input('Consumer secret?')
consumer_secret = consumer_secret.strip()
request_token_url = 'http://www.tumblr.com/oauth/request_token'
@WanaByte
WanaByte / ajax_example.html
Created January 21, 2013 17:13
Just a basic ajax example which works on JS bin.
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script>
$(document).ready(function() {
$('a.ajax-trigger').on('click', function(event) {
event.preventDefault(); // Stop the click from going anywhere
$.ajax('/help', {
type: 'GET',
@WanaByte
WanaByte / tumblr_handshake.py
Last active June 16, 2024 11:46
A python script to do the OAuth dance with Tumblr's API
import urlparse
import oauth2 as oauth
consumer_key = 'YOUR_KEY'
consumer_secret = 'YOUR_SECRET'
request_token_url = 'http://www.tumblr.com/oauth/request_token'
access_token_url = 'http://www.tumblr.com/oauth/access_token'
authorize_url = 'http://www.tumblr.com/oauth/authorize'
@WanaByte
WanaByte / Problem_Description.txt
Created October 30, 2011 04:39
Stock Portfolio
Write a program that reads the portfolio in portfolio.dat, the stock prices in prices.dat, and prints out how much the portfolio has increased or decreased.
Extra Credit: 
Portfolio.dat and prices.dat both have a small number of stocks. At the meetup, a second set of files will have a much larger number of stocks to analyze. We'll use the comparison between both sizes to talk about writing code that is reusable and that scales to handle a larger number of inputs. 
@WanaByte
WanaByte / gist:1249169
Created September 28, 2011 20:31 — forked from derekg/gist:1198576
Example of uploading photos to Tumblr w/ the V2 API # http://www.tumblr.com/docs/en/api/v2
import urllib,hmac,time,hashlib,base64,httplib,sys,json,urlparse
## This is just a simple example that is self contained.
## You will need to modified it to make it work
##
## creds - need to be filled out
## blognmae - needs to be defined
##
## reads in image files from the command line and posts to your blog