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 / 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);
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 / app.js
Created November 12, 2015 13:43
Uses twitter api to send a tweet from a button press on an arduino. requires arduino to have basic sketch that Serial.prints when button is pressed.
//requires the twitter and serialport node modules
// requires you capture a button press from the Arduino - see bottom for basic Arduino sketch
//NODE[save as app.js] ------------------------------------------------------------------
var Twitter = require('twitter');
var client = new Twitter({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
@bitchwhocodes
bitchwhocodes / gist:72f511f9983de14cb787
Created December 22, 2014 04:52
TweetHeart Node.js Spark
var http = require("http");
var Twit = require('twit')
var Spark = require("spark");
var dotenv = require('dotenv');
dotenv.load();
Spark.login({ username: process.env.USER_NAME, password: process.env.PASS_WORD }, function(err, body) {
//to handle
});
@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: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:49a1ee4e8a03b8858b88
Created November 20, 2014 21:21
Calling Spark Cloud API on Interval and starting Babylon.js Particle system
setInterval(function(){
$.ajax("https://api.spark.io/v1/devices/{YOUR_SPARK_ID}/pressure?access_token={YOUR_ACCESS_TOKEN}")
.done(function(obj){
if(obj.result < 10){
scene.particleSystem.start();
}else{
scene.particleSystem.stop();
}
})
@bitchwhocodes
bitchwhocodes / gist:8750741951f5ee1d9709
Last active August 29, 2015 14:10
Unity3d JsonObject WWW to call SparkCore API
using UnityEngine;
using System.Collections;
using System.Net;
using System.IO;
public class Plane : MonoBehaviour
{
public Vector2 jumpForce = new Vector2 (0, 300);
private WWW www;