Skip to content

Instantly share code, notes, and snippets.

@abidibo
abidibo / gist:ee6027384d25a19b86d4
Created January 10, 2015 11:39
get integer complement
function getIntegerComplement( $n) {
$n = (int) $n;
$mask = bindec(str_repeat('1', strlen(decbin($n))));
$val = $n ^ $mask;
return $val;
}
@abidibo
abidibo / miniaturize-jquery.js
Last active August 29, 2015 14:14
responsive menu with bootstrap
// requires jquery
var abidibo = abidibo || {};
abidibo.menu = {};
// miniaturized menu
abidibo.menu.miniaturize = function(event) {
// ff mobile
window.scrollTo(0, 0);
@abidibo
abidibo / lightscribe
Last active August 29, 2015 14:14
lightscribe ubuntu 14.04
(http://reubuntu.blogspot.it/2014/02/lightscribe-e-una-tecnologia-di.html)
(http://stackoverflow.com/questions/23182765/how-to-install-ia32-libs-in-ubuntu-14-04-lts-trusty-tahr)
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
http://download.lightscribe.com/ls/lightscribe-1.18.8.1-linux-2.6-intel.deb
http://download.lightscribe.com/ls/lightscribeApplications-1.18.6.1-linux-2.6-intel.deb
https://www.lacie.com/download/drivers/LaCie%20LightScribe%20Labeler%201.0%20Linux.rpm (https://www.lacie.com/us/support/drivers/driver.htm?id=10061)
@abidibo
abidibo / res1
Created April 30, 2015 15:36
Webcomponents, mica pizza e fichi - res 1
<slideshow>
<img src="//lorempixel.com/670/401" alt="img-1" />
<img src="//lorempixel.com/670/400" alt="img-2" />
<img src="//lorempixel.com/670/399" alt="img-3" />
</slideshow>
"use strict";
var numberStringToText;
(function() {
var dict = {
'0': ' ',
'00': '0',
'1': '1',
'11': ',',
'111': '.',
'1111': ':',
@abidibo
abidibo / track-subclasses.py
Created January 15, 2016 11:52
Track Subclasses in Python
class PluginMount(type):
def __init__(cls, name, bases, attrs):
print cls
if not hasattr(cls, 'plugins'):
cls.plugins = []
else:
print cls.plugins
cls.plugins.append(cls)
print cls.plugins
@abidibo
abidibo / MainActivity.java
Created January 18, 2016 13:53
Fetch json from main activity
package org.torinometeo.tmforecast;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;
@abidibo
abidibo / hak5.md
Last active February 17, 2016 12:48
hak5

Stuff

##Shell

Copy and paste command directly in favourite text editor

ctrl-x ctrl-e

while in terminal

@abidibo
abidibo / README.md
Created February 24, 2016 12:12
metasploit