Skip to content

Instantly share code, notes, and snippets.

View jmsaavedra's full-sized avatar

Joe Saavedra jmsaavedra

View GitHub Profile
@jmsaavedra
jmsaavedra / urldecode.ino
Created December 14, 2013 20:08
URL encoded string to character string (for arduino here)
char *in = "!%40%23%24%25%5e%26*()_%2b";
char *out = "000000000000000000000000000000";
void setup(){
Serial.begin(9600);
while(!Serial){
;
}
Serial.println(in);
urldecode2(out,in);
@jmsaavedra
jmsaavedra / ofGetAppPtrExample.md
Last active August 26, 2017 18:24
example use of ofGetAppPtr()

###ofGetAppPtr() example

from a .cpp file, for example, "particle.cpp" you can do two things:

  • a) include "ofApp.h" (so you know what's inside the ofApp)
  • b) cast the ofGetAppPtr as a ptr

you can't include ofApp.h inside another .h file, as you would recursive includes (ie, ofApp includes particle, particle includes ofApp), but putting it in the .cpp is fine.

//#include <WiFlyHQ.h>
/*
- download visualight library from here:
https://github.com/lpercifield/visualight/releases/download/1.1/Visualight.zip
- unzip, put in the Documents > Arduino > libraries folder
*/
#include <EEPROM.h>
@jmsaavedra
jmsaavedra / index.php
Last active August 29, 2015 13:58
PHP simpleXML example
<?php
//first grab the xml file
$xml=simplexml_load_file("http://www.stateair.net/web/rss/1/1.xml");
/* simpleXML let's you parse through the entire file */
/* info: http://www.w3schools.com/php/php_xml_simplexml.asp */
//foreach($xml->children() as $child) {
// echo $child->getName() . ": " . $child . "<br>";
//}
@jmsaavedra
jmsaavedra / gist:9996360
Last active August 29, 2015 13:58
arduino_write 3 bytes
char inByte; // incoming serial byte
int count1; //for some fake data
int count2; //even more fake data
void setup() {
// start serial port at 115200 bps:
Serial.begin(115200);
// while (!Serial) {
// ; // wait for serial port to connect. Needed for Leonardo only
@jmsaavedra
jmsaavedra / ffmpeg_concat.md
Last active October 18, 2019 04:28
FFmpeg Concat Strategies
@jmsaavedra
jmsaavedra / aws-server-configuration.md
Last active April 23, 2018 19:10 — forked from piuggi/AWS_NODE_FOREVER_SETUP.md
AWS Ubuntu Server Setup incl Node, Mongodb, Port Forwarding

AWS SERVER CONFIGURATION

Configuring an Ubuntu AWS Box with Node, Mongodb, and Forever with port forwarding


  • Login to aws.amazon.com and create an EC2 instance with a standard Ubuntu (14.04) installation.
  • Create a Security Group that allows type SSH on port 22 and HTTP on port 80.
  • Download the .pem file (during setup) which we'll use to authenticate into your server via terminal.
  • Modify permissions on the .pem file downloaded from AWS
$ chmod 0600 ~/Downloads/{your_key}.pem
@jmsaavedra
jmsaavedra / _openFrameworks data to arduino over serial.ino
Last active August 29, 2015 14:01
Serial control of Arduino. After kick-off message is sent from OF and a response is received from Arduino, OF continually updates Arduino with 3 bytes of data via a call and response driven by Arduino.
int bytesReceived[3]; //incoming bytes
void setup() {
pinMode(13, OUTPUT); //LED on 13
pinMode(12, OUTPUT); //LED on 12
Serial.begin(9600);
}
void loop()
@jmsaavedra
jmsaavedra / rPi-SD-imaging.md
Last active July 24, 2017 23:10
raspberry Pi SD card formatting and image copying

SD CARD IMAGE COPY AND RESTORE


great for RaspberryPi disk imaging and copying.

LOCATE AND UNMOUNT DISK

insert SD card into computer. to see all volumes mounted to machine:

$ diskutil list
@jmsaavedra
jmsaavedra / .gitignore
Last active June 1, 2022 10:09
gitignore template
###################################
# general ignore patterns
###################################
build/
obj/
*.o
Debug*/
Release*/
*.mode*