Skip to content

Instantly share code, notes, and snippets.


Ismaïl Baaj ibaaj

  • Paris, France
View GitHub Profile
ibaaj / Rgb2hsv in Coffeescript
Created Feb 6, 2014
Rgb2hsv in Coffeescript
View Rgb2hsv in Coffeescript
rgb2hsv (r,g,b) ->
max = Math.max(r,g,b)
min = Math.min(r,g,b)
v = max
d = max - min
ibaaj / parsing_essentia_yaml_export.js
Last active Aug 29, 2015
Parsing essentia yaml export - find . -name "*.yaml" -exec node conv.js {} \;
View parsing_essentia_yaml_export.js
yaml = require('js-yaml');
fs = require('fs');
try {
var doc = yaml.safeLoad(fs.readFileSync(process.argv[2], 'utf8'));
var nLine = process.argv[2] + ','
+ doc.metadata.audio_properties.length + ','
+ doc.rhythm.bpm + ','
ibaaj / laptop.local.linux
Last active Aug 29, 2015
View laptop.local.linux
sudo add-apt-repository ppa:webupd8team/atom
sudo add-apt-repository ppa:jon-severinsson/ffmpeg
sudo add-apt-repository ppa:jerzy-kozera/zeal-ppa
sudo apt-get update
sudo apt-get install atom
sudo apt-get install mongodb
sudo apt-get install npm
sudo apt-get install node
sudo npm install -g coffee-script
ibaaj / pageMonitor.js
Last active Aug 29, 2015
Page Monitor NodeJS - usage: node pageMonitor.js 300
View pageMonitor.js
var http = require('http');
var url = require("url");
var crypto = require('crypto');
if(process.argv.length != 4)
console.log('Syntax ::');
console.log('node pagemonitor.js 300');
console.log('with 300 the interval check (in seconds (300s = 5min)).');
ibaaj / auto.js
Created Nov 3, 2014
View auto.js
var list = document.getElementById("box").getElementsByTagName("span"), bgUsed={};
for (var i = 0, len = list.length; i < len; i++) {
var e = list[i].style.backgroundColor;
if(Object.keys(bgUsed).length==0){bgUsed[e]=i; continue;}
if(!bgUsed.hasOwnProperty(e)) {bgUsed[e]=i; continue; }
else if(Object.keys(bgUsed).length > 1) { delete bgUsed[e]; break;}
ibaaj /
Created Nov 11, 2014
Twitter block a list of user with TwitterAPI
import codecs
from datetime import datetime
import sys
from TwitterAPI import TwitterAPI, TwitterOAuth, TwitterRestPager
###Supposed you have a large list of username like this in a txt file (here: o.txt) :
ibaaj /
Last active Aug 29, 2015
facebook Graph online people / hour
import sys
import os
import urllib2
import json
import urllib
from time import strftime, sleep
def write_to_file(data):
if os.path.exists("fb_data.txt"):
ibaaj / unfollow.js
Created Jun 14, 2015
Unfollow all pages i've liked on facebook - Go to[YOURUSERNAME]/likes & Scroll down to show all pages & execute this script in the console
View unfollow.js
counter=0; var ids = [];
for(var i=0; i < document.getElementsByClassName('_42ft _4jy0 _5lzj _3spg _4jy3 _517h _51sy').length; i++){
var d = document.getElementsByClassName('_42ft _4jy0 _5lzj _3spg _4jy3 _517h _51sy')[i];
ibaaj / MITM
Created Dec 7, 2015 — forked from jeremiahsnapp/MITM
Man In The Middle (MITM) SSL Proxies - Simple ways to see traffic between an SSL server and client in clear text.

HTTP(S) specific MITM SSL Proxies


mitmproxy is an excellent console app written in Python.

It is easy to use on Linux and OS X.

Use brew install mitmproxy to install it on OS X.

ibaaj / Edge Element stopped at its percentage seen in viewport
Created Jan 24, 2014
snippet of code working with skrollr to stop a Adobe Edge Composition at a defined timeline according to its percentage seen in viewport
View Edge Element stopped at its percentage seen in viewport
function percentageSeen (id) {
var $element = $('#'+id), $win = $(window),viewportHeight = $(window).height(),
scrollTop = $win.scrollTop(),
elementOffsetTop = $element.offset().top,
elementHeight = $element.height();
if (elementOffsetTop > (scrollTop + viewportHeight)) {
return 0;