Skip to content

Instantly share code, notes, and snippets.

@bitchwhocodes
bitchwhocodes / customvis.py
Created January 22, 2018 06:51
Custom Vision API Prediction - PYthon
import requests
import json
url="YOUR_PREDICTION_ENDPOINT _ AVAIL customvision.ai"
headers={'content-type':'application/octet-stream','Prediction-Key':'YOUR_PREDICTION_KEY'}
r =requests.post(url,data=open("YOUR_LOCAL_IMAGE.jpg","rb"),headers=headers)
print(r.content)
@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:1b3297bd3dbf7be93f72
Created December 22, 2014 02:31
Arduino NeoPixels Animation without using Delay
#include <Adafruit_NeoPixel.h>
#define NUM_PIXELS 60
unsigned long interval=50; // the time we need to wait
unsigned long previousMillis=0;
uint32_t currentColor;// current Color in case we need it
uint16_t currentPixel = 0;// what pixel are we operating on
@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 / Processing Class
Created January 11, 2017 22:53
Basic Processing Class - Go down sketch by sketch
//DRAW A RECT
//DRAW AN ELLIPSE/CIRCLE////////
void setup() {
size(500,400);
background(0);
}
void draw() {
rect(100,100,100,100);
@bitchwhocodes
bitchwhocodes / gist:aa9d3426d35a09ef3918
Created December 22, 2014 02:20
Arduino Avoid Delay
unsigned long interval=50; // the time we need to wait
unsigned long previousMillis=0;
void setup(){
}
void loop(){
if ((unsigned long)(millis() - previousMillis) >= interval) {
previousMillis = millis();
@bitchwhocodes
bitchwhocodes / gist:45a2997376c71bb26857
Created October 29, 2014 00:41
SkrillTRex- Processing and Arduino
import processing.serial.*;
import cc.arduino.*;
import ddf.minim.*;
import processing.video.*;
// Number of columns and rows in our system
int cols, rows;
// Variable to hold onto Capture object
Capture video;
PImage output;
var items = [1,2,3,4];
var arrayCounter = -1;
function getFace(i)
{
// ajax call
//when done call
// getFaceComplete()
}
MVA
Unity:
· Building Windows 10 Games with Unity 5: https://mva.microsoft.com/en-US/training-courses/building-windows-10-games-with-unity-5-12572
· Developing 2D & 3D Games with Unity for Windows Jump Start: https://mva.microsoft.com/en-US/training-courses/developing-2d-3d-games-with-unity-for-windows-jump-start-8350
· Porting Unity Games to Windows Store and Windows Phone: https://mva.microsoft.com/en-US/training-courses/porting-unity-games-to-windows-store-and-windows-phone-8351
Web / HTML5:
· Developing 2D Games with HTML5: https://mva.microsoft.com/en-US/training-courses/developing-2d-games-with-html5-8418
· Developing Advanced 2D Games with HTML5: https://mva.microsoft.com/en-US/training-courses/developing-advanced-2d-games-with-html5-8452
GameMaker:
@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!