Skip to content

Instantly share code, notes, and snippets.

View loretoparisi's full-sized avatar
🐍
NightShift

Loreto Parisi loretoparisi

🐍
NightShift
View GitHub Profile
@loretoparisi
loretoparisi / README
Created March 6, 2016 23:11
netflix-prize
SUMMARY
================================================================================
This dataset was constructed to support participants in the Netflix Prize. See
http://www.netflixprize.com for details about the prize.
The movie rating files contain over 100 million ratings from 480 thousand
randomly-chosen, anonymous Netflix customers over 17 thousand movie titles. The
data were collected between October, 1998 and December, 2005 and reflect the
distribution of all ratings received during this period. The ratings are on a
@loretoparisi
loretoparisi / README
Created March 6, 2016 23:11
netflix-prize
SUMMARY
================================================================================
This dataset was constructed to support participants in the Netflix Prize. See
http://www.netflixprize.com for details about the prize.
The movie rating files contain over 100 million ratings from 480 thousand
randomly-chosen, anonymous Netflix customers over 17 thousand movie titles. The
data were collected between October, 1998 and December, 2005 and reflect the
distribution of all ratings received during this period. The ratings are on a
@loretoparisi
loretoparisi / LPLogger.js
Created March 10, 2016 16:00
Colors Logger to Browser Console or Node Shell
/**
* Node or Browser Console Logger
* @author: Loreto Parisi (loretoparisi gmail dot com)
*/
var LP Logger = {
/** True if browser console, False if is node */
isConsole : ((typeof process === 'object' && process + '' === '[object process]')?false:true),
level:0,
@loretoparisi
loretoparisi / kmeans.m
Created March 14, 2016 18:23
Matlab KMean Clustering Example
%{
Matlab Kmean example
@author Loreto Parisi (loretoparisi at musixmatch dot com)
@2015-2016 Musixmatch Spa.
%}
%{ clean all figures and dock new figure }
close all;
figure
try
@loretoparisi
loretoparisi / crawler.js
Created April 4, 2016 20:12
Simple Crawler with Node Phantom
/**
* Simple Crawler with Node Phantom
* @author: loretoparisi at gmail dot com
*/
(function() {
var Crawler,phantom,cheerio;
cheerio = require("cheerio"),
phantom = require('phantom');
#!/bin/bash
PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
else
apt-get update
apt-get install -y build-essential chrpath libssl-dev libxft-dev
apt-get install -y libfreetype6 libfreetype6-dev
apt-get install -y libfontconfig1 libfontconfig1-dev
@loretoparisi
loretoparisi / example.js
Created April 6, 2016 10:15 — forked from domenic/example.js
Promise chaining example
// `promise` is some operation that may succeed (fulfill) or fail (reject)
var newPromise = promise.then(
function () {
return delay(1000);
},
writeError
);
// If `promise` fulfills, `newPromise` will fulfill in 1000 ms.
// If `promise` rejects and writing to the error log succeeds,
@loretoparisi
loretoparisi / Promise+XMLHttpRequest.js
Last active April 13, 2016 00:35
Example of using native Promise with deferred XMLHttpRequest
var console = {
log: function(s) {
document.getElementById("console").innerHTML += s + "<br/>"
}
}
// Simple XMLHttpRequest
// based on https://davidwalsh.name/xmlhttprequest
SimpleRequest = {
call: function(what, response) {
var request;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@loretoparisi
loretoparisi / 00.howto_install_phantomjs.md
Created April 7, 2016 12:39 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev