Skip to content

Instantly share code, notes, and snippets.

View jmsaavedra's full-sized avatar

Joe Saavedra jmsaavedra

View GitHub Profile
@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 / ffmpeg_concat.md
Last active October 18, 2019 04:28
FFmpeg Concat Strategies
@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 / 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>";
//}
//#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 / 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.

@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);