Skip to content

Instantly share code, notes, and snippets.

View mcollina's full-sized avatar

Matteo Collina mcollina

View GitHub Profile
var five = require("johnny-five"),
board, sensor;
board = new five.Board();
board.on("ready", function() {
sensor = new five.Sensor({ pin: 0, freq: 250 });
board.repl.inject({
sensor: sensor
});
@mcollina
mcollina / jschan
Last active August 29, 2015 14:04
libchan vs jschan
00000000 86 a4 41 72 67 73 91 a5 68 65 6c 6c 6f a3 43 6d |..Args..hello.Cm|
00000010 64 a4 65 63 68 6f aa 53 74 61 74 75 73 43 68 61 |d.echo.StatusCha|
00000020 6e c7 05 01 02 00 00 00 03 a6 53 74 64 65 72 72 |n.........Stderr|
00000030 d6 02 00 00 00 05 a5 53 74 64 69 6e d6 02 00 00 |.......Stdin....|
00000040 00 07 a6 53 74 64 6f 75 74 d6 02 00 00 00 09 |...Stdout......|

Keybase proof

I hereby claim:

  • I am mcollina on github.
  • I am matteocollina (https://keybase.io/matteocollina) on keybase.
  • I have a public key whose fingerprint is 93D5 470F 79EB D334 120A 3710 41E7 5C25 33C8 E6EA

To claim this, I am signing this object:

@mcollina
mcollina / tarappend.js
Created June 19, 2015 10:57
Appending to a tar file
var tar = require('tar-stream')
var concat = require('concat-stream')
var assert = require('assert')
var pack1 = tar.pack()
pack1.entry({
name: 'hello'
}, 'hello world')
@mcollina
mcollina / improve_delayed_jobs_index.rb
Created February 5, 2011 10:50
A migration to improve Delayed Job performance when runned with Delayed::Worker.destroy_failed_jobs = false.
class ImproveDelayedJobsIndex < ActiveRecord::Migration
def self.up
remove_index :delayed_jobs, :name => "delayed_jobs_priority"
add_index :delayed_jobs, [:failed_at, :priority, :run_at], :name => 'delayed_jobs_priority'
end
def self.down
remove_index :delayed_jobs, :name => "delayed_jobs_priority"
add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority'
end
@mcollina
mcollina / .gitignore
Created March 25, 2011 08:50
Not working rack pagespeed application
*~
public/rack-*
@mcollina
mcollina / back.js
Created May 17, 2011 15:24
Sencha Touch Back Button Plugin
BackButton = Ext.extend(Ext.Button, {
ui: 'back',
text: 'Back',
hidden: true,
id: 'back',
handler: function() {
var dispatchOptions = this.backStack.pop();
Ext.dispatch(dispatchOptions);
if(this.backStack.length == 0) {
@mcollina
mcollina / .gitignore
Created October 5, 2011 15:30
Syck::Syck errors for Delayed Job
*~
@mcollina
mcollina / country.json
Created November 8, 2011 21:56
SharpNodes Use Case 1 APIs
// GET /COUNTRY/[COUNTRY_NAME]
{
"opennet_filtering_data": {
"political": {"score": INT},
"social": {"score": INT},
"tools": {"score": INT},
"conflict_security" : {"score": INT}
},
"google_removal_requests": {
@mcollina
mcollina / spam-mail
Created November 9, 2011 08:48
First time spam from github
Hello
My Dear How are you my name is Miss Anna I saw your profile today at github.com and become interested here is my e-mail address (annababyjammeh@yahoo.fr) Please try to send e-mail so that I can give my picture.for to know who I am yours
Miss Anna.