Skip to content

Instantly share code, notes, and snippets.

View nicola's full-sized avatar

Nicola nicola

View GitHub Profile
@nicola
nicola / b2g_finder.py
Last active August 29, 2015 14:04
Find open FirefoxOS connection open and listening for remote debugging
import psutil
def get_connections(p):
try:
return p.get_connections()
except:
return []
# Find open FirefoxOS connection open and listening for remote debugging
import psutil
def get_connections(p):
try:
return p.get_connections()
except:
return []
@nicola
nicola / b2g_discovery.js
Last active August 29, 2015 14:04
Discover a B2G simulator port in NodeJS
var discoverPorts = function (callback) {
var ports = [];
if (os == 'darwin') {
var output = exec(LSOF_CMD, {silent: true}).output;
var regex = /^b2g[-bin]?.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:([0-9]*)/;
var lines = output.split('\n');
for (var line=0; line < lines.length; line++) {
var matches = regex.exec(lines[line]);
@nicola
nicola / gulpfile.js
Last active August 29, 2015 14:05
Gulpfile.js to deploy and live-edit css on FirefoxOS
var gulp = require('gulp');
var deploy = require('moz-deploy-b2g');
var reloadcss = require('moz-reloadcss-b2g');
var zip = require('gulp-zip');
var paths = {
build: ['**/*.html', '**/*.properties', '**/*.js', '!**/node_modules/**/*'],
css: ['**/*.css'],
};
@nicola
nicola / gist:ddca0e9cf7b565b4fc70
Created November 17, 2014 11:09
Open all the iMessage attachements on mac
node getAttachments.js | grep filename | sed "s/\ *filename:\ '~\(.*\),/'\/Users\/mozilla\1/" | sed 's/^/open\ /g'
@nicola
nicola / README.md
Last active August 29, 2015 14:10
Visualizing London Tube map with Barclays' bikes

This aims at visualizing Barclays bikes against the tube map

@nicola
nicola / README.md
Last active August 29, 2015 14:10
Visualizing empty and full Barclays' bikes stops

Visualizing empty and full Barclays' bikes stops

  • Red is full (2 empty spaces left)
  • Green is empty (2 bikes left)
@nicola
nicola / README.md
Last active August 29, 2015 14:10
Visualizing London tube with TubemapJS

See the tubemaps library

This is part of a set of visualisation that try to improve the Barclay's bike distribution in London. Visualizing the map of the London Tube is the first step to understand any correlation with bikes usage.

Aim

The technical aim I tried to achieve, is a very simple codebase that enables interaction (such as zooming) for later data analysis.

Inspiration

I have been using RandomETC's idea. However, in order to support scaling and to have a more structured code-base, most of the code has been re-written.

@nicola
nicola / README.md
Last active August 29, 2015 14:10
Visualizing Tube closures

Showing how you can visualize tube closures with TubeMaps

@nicola
nicola / README.md
Last active August 29, 2015 14:10
London TubeMap with Voronoi showing closures and Cycle Hire bikes