Skip to content

Instantly share code, notes, and snippets.

@bitchwhocodes
bitchwhocodes / gist:6ceb19eb2b12a0eb8704
Created November 20, 2014 20:28
SparkCore Analog Pressure Sensor
#include "lib1.h"
double pressure = 0.0;
// This routine runs only once upon reset
void setup() {
// we want to save this variable to use with the rest api
Spark.variable("pressure", &pressure, DOUBLE);
pinMode(A0, INPUT);
@bitchwhocodes
bitchwhocodes / gist:bc4a41b5d6ed44668a71
Created November 20, 2014 20:27
Arduino - Pressure Sensor Analog
int pressurePin = A0; // select the input pin for the potentiometer
void setup() {
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
pressure = analogRead(pressurePin);
Serial.println(pressure);
@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;
@bitchwhocodes
bitchwhocodes / gist:e0a8f37ea0d3b3c28264
Created September 27, 2014 13:45
Wordpress Submodule Workflow
// Initialize a git repo
git init
touch README.md
git add README.md
git commit -m "Initial commit."
//Set up the WordPress module - notice we are putting it in a folder
git submodule add git://github.com/WordPress/WordPress.git wordpress
git commit -m "Adding WP as a submodule"
// navigate to the wordpress folder - notice to deal with the submodule you need to work in it
@bitchwhocodes
bitchwhocodes / gist:fcb4ce79a50b6b590f90
Created September 24, 2014 16:10
Wordpress Git Ignore
# Remove SASS cache files #
wp-content/themes/{themename}/.sass-cache/*
# No need to add the upgrade folder to the repo #
wp-content/upgrade/*
# No need to add the uploads folder to the repo #
wp-content/uploads/*
# No need to add the plugins folder to the repo #
@bitchwhocodes
bitchwhocodes / gist:36694e45c030925bb02e
Last active August 29, 2015 14:05
Twilio Python AP from Raspberry Pi
import RPi.GPIO as GPIO
from twilio.rest import TwilioRestClient
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(25,GPIO.IN,pull_up_down=GPIO.PUD_DOWN)
try:
GPIO.wait_for_edge(25,GPIO.RISING)
print("button pressed")
ACCOUNT_SID = "[account id]"
@bitchwhocodes
bitchwhocodes / gist:dfeec09ce4724078d28d
Created July 29, 2014 16:14
Spacebrew Processing Connect
import spacebrew.*;
import processing.serial.*;
String server = "sandbox.spacebrew.cc";
String name = "Processing_CLIENT;
String description = "Testing from processing ";
// TAKEN FROM THE SPACEBREW TUTORIAL - JUST MODIFIED TO SIMPLIFY W/O ARDUINO
Spacebrew spacebrewConnection; // Spacebrew connection object
@bitchwhocodes
bitchwhocodes / gist:8e1b3e606ef82ac3c3c8
Created July 29, 2014 15:57
Spacebrew node dependencies
npm list
npm install ws
npm install monitor-forever
node node_server_forever.js
@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*/
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int led = 12;
int button = 2;
int value = 0;
void setup() {