Skip to content

Instantly share code, notes, and snippets.

Lorenzo Stanco lorenzos

Block or report user

Report or block lorenzos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lorenzos
lorenzos / color_picker
Created Oct 28, 2014
Pick color and store #HEX in system clipboard
View color_picker
#!/usr/bin/env python
import gtk
import gobject
import pynotify
import sys
# Clipboard object
clipboard = None
View ordered_hm.js
/*
* Simple hash map using javascript objects and an ordered array.
* Repeated elements are not allowed.
*
* @param sort_method By default is ASC order, but you can specified whatever you want.
*
* The public methods are:
* -set
* -get
* -del
@lorenzos
lorenzos / android-screen-to-gif.sh
Last active Mar 30, 2019
Captures screen from Android device via ADB and makes a 180x320 GIF
View android-screen-to-gif.sh
#!/bin/bash
# How to install:
# exo-open "http://developer.android.com/sdk/index.html#Other"
# sudo apt-get install libav-tools imagemagick
# wget https://gist.githubusercontent.com/lorenzos/e8a97c1992cddf9c1142/raw/android-screen-to-gif.sh
# chmod a+x android-screen-to-gif.sh
# Help message
function usage() {
@lorenzos
lorenzos / byzanz-record-ui.sh
Created Jul 14, 2015
Records a portion of your screen to an animated GIF
View byzanz-record-ui.sh
#!/bin/bash
#
# RECORDS A PORTION OF YOUR SCREEN TO AN ANIMATED GIF
#
# REQUIREMENTS:
# byzanz: Screen recorder, found in repos
# zenity: Dialogs and notifications, found in repos
# xrectsel: Screen portion selector, found at https://github.com/lolilolicon/xrectsel
#
@lorenzos
lorenzos / better_mootools_docs.css
Last active Jun 1, 2017
Better Mootools docs - User script & user styles
View better_mootools_docs.css
@-moz-document url-prefix("http://mootools.net/core/docs/"), url-prefix("http://mootools.net/more/docs/"), url-prefix("https://mootools.net/core/docs/"), url-prefix("https://mootools.net/more/docs/") {
#global-bar {
padding-bottom: 10px;
padding-top: 10px;
}
#logo p img {
width: auto;
height: 20px;
@lorenzos
lorenzos / youtube-pl-dump.js
Last active Sep 13, 2019
Dump YouTube playlist data from console to JSON
View youtube-pl-dump.js
var dump = Array.from(document.querySelectorAll('ytd-playlist-video-list-renderer ytd-playlist-video-renderer')).map(item => {
return {
id: item.querySelector('a').href.match(/v=([^&]+)&/)[1],
title: item.querySelector('h3 span').textContent.trim(),
thumb: item.querySelector('ytd-thumbnail img').src,
by: item.querySelector('ytd-channel-name').textContent.trim() || null
};
});
var url = URL.createObjectURL(new Blob([JSON.stringify(dump)], { type: "application/json" }));
window.open(url);
@lorenzos
lorenzos / discord-dark-sidebar.user.js
Last active Sep 10, 2019
Userscript for making Discord sidebar in Light theme dark again, after September 2019 update.
View discord-dark-sidebar.user.js
// ==UserScript==
// @name Discord dark sidebar for Light theme
// @namespace Violentmonkey Scripts
// @match https://discordapp.com/*
// @grant none
// ==/UserScript==
var style = `
/*
You can’t perform that action at this time.