Skip to content

Instantly share code, notes, and snippets.

@bitchwhocodes
bitchwhocodes / gist:5824908
Last active December 18, 2015 18:19
Pull your twitter timeline tweets ( or another user ) using python and tweepy and save to file
import sys
import tweepy
import re
import time
#for encoding to the terminal window
reload(sys)
sys.setdefaultencoding("utf-8")
def replace_url_to_link(value):
@bitchwhocodes
bitchwhocodes / gist:5840886
Created June 22, 2013 13:38
Basic instagram api with JS - open endpoints, Requires jquery
var Instagram = function () {
// this will be a private property
var clientId = '';
var baseUrl = 'https://api.instagram.com/v1';
// this will be a public method
var init = function (client_Id) {
clientId = client_Id;
}
@bitchwhocodes
bitchwhocodes / gist:5840934
Created June 22, 2013 13:51
Foursquare api using JS - accessing endpoints that don't require authorization. Requires jquery
var Foursquare = function () {
/*
Please register a client/app with foursquare ( https://developer.foursquare.com)
and put the client id and secret in the apiglobals.js
NOTE: Didn't want to use require for this, but it would be easy to port it
and have its required dependancies be Jquery and apiglobals.js
*/
var init = function (client_id,client_secret) {
@bitchwhocodes
bitchwhocodes / gist:5843193
Last active December 18, 2015 20:49
ESPN Basic API via JS. Depends on jquery( could be removed )
var ESPN = function () {
/*
DEPENDANCIES: jquery for the JSON calls & promises
IMPORTANT:Please register with Mashery and ESPN to get an api key (http://developer.espn.com/)
NOTE: Didn't want to use require for this, but it would be easy to port it
INITIALIZE: You need to init this class with your apikey ( ESPN.init('your-app-key-here');)
READ: Read the espn documentation to see what type of paramters you can pass in - didn't duplicate documentation here.
All calls are documented and show example usage.
Use at own risk!
@bitchwhocodes
bitchwhocodes / gist:9102400
Last active January 21, 2022 05:17
Gist to get the raw text from an epub for all chapters using Python, NLTK, EPUB
import nltk
import epub
book = epub.open_epub('design-is-a-job.epub')
for item in book.opf.manifest.values():
# read the content
data = book.read_item( item )
if 'html' in item.href and 'chap' in item.href:
print item.href
#print data
@bitchwhocodes
bitchwhocodes / gist:a99a26580b8659e76a6a
Last active August 29, 2015 14:04
Unity3d and Spacebrew - Script for button ( SendButton.cs)
using UnityEngine;
using System.Collections;
public class SendButton : MonoBehaviour {
// Use this for initialization
SpacebrewClient sbClient;
// Use this for initialization
using UnityEngine;
using System.Collections;
public class SpacebrewEvents : MonoBehaviour {
SpacebrewClient sbClient;
// Use this for initialization
void Start () {
GameObject go = GameObject.Find ("SpacebrewObject"); // the name of your client object
@bitchwhocodes
bitchwhocodes / gist:3b9a0ca4838aee560a10
Created July 24, 2014 22:39
SpacebrewProcessingSketch
import spacebrew.*;
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
String server = "ws://localhost:9000";
String name = "Bitchwhocodes_" + floor(random(1000));
String description = "Testing Unity to Arduino";
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int led = 12;
int button = 2;
int value = 0;
void setup() {
@bitchwhocodes
bitchwhocodes / gist:76bebb4694d6552e2cc3
Last active August 29, 2015 14:04
Basic Sketch for Spacebrew, Arduino and Processing with a circuit that has an LED & Button Input
import processing.serial.*;
import cc.arduino.*;
import spacebrew.*;
Arduino arduino;
Spacebrew spacebrewConnection; // Spacebrew connection object
/*Future versions of the Spacebrew library will not support WS*/