Skip to content

Instantly share code, notes, and snippets.

@z3a
z3a / trashcan.js
Last active December 28, 2015 20:29
var mysql = require('mysql');
var gpio = require("gpio");
var moment = require('moment');
var osc = require('node-osc');
var _ = require('underscore');
var pinNum = 17;
var fecha = moment('2013-11-06 11:20:35');
var client = new osc.Client('192.168.2.4', 11234);
import processing.serial.*;
//http://forum.arduino.cc/index.php/topic,39922.0.html
PImage img;
int x = 0;
float r,g,b,bright;
Serial myPort;
byte[] column = new byte[16]; //var para guardar las lecturas de la img
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
for i in *.JPG; convert -resize 10% $i $i:r.png
String response = "Hello 1,2345 10 lorem ipsum 12 dol 34 sit 093 at bla 8749";
void setup(){
String[][] test = matchAll(response, "([1-4])");
if (test != null){
for (int i = 0; i<test.length; i++){
println("text: "+test[i][1]);
}
} else {
long previous;
int interval = 400;
void setup(){
previous = 0;
}
void draw(){
long current = millis();
@z3a
z3a / gist:3643654
Created September 5, 2012 20:02
regex
#regex
def findNumber(path):
reGex = re.compile('\d+')
match = reGex.search(path)
return match.group()
@z3a
z3a / gist:3520037
Created August 29, 2012 23:02
twitter desde id
long ultimo_tweet = 0;
searchResult = twitter.search("#testing", ultimo_tweet);
for (int i=0; i<searchResult.size(); i++) {
Tweet t = (Tweet)searchResult.get(i);
String user = t.getFromUser();
String msg = t.getText();
Date d = t.getCreatedAt();
ultimo_tweet = t.getId();
println(id);