This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import gtk | |
import gobject | |
import pynotify | |
import sys | |
# Clipboard object | |
clipboard = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dump = () => { | |
const 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')?.textContent?.trim() || null, | |
thumb: item.querySelector('ytd-thumbnail img')?.src || null, | |
by: item.querySelector('ytd-channel-name #text-container')?.textContent?.trim() || null, | |
length: item.querySelector('.ytd-thumbnail-overlay-time-status-renderer:not([hidden])')?.textContent?.trim() || null | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GENERATES ALL PARTITIONS OF A SET OF ELEMENTS | |
// A thorough definition can be found on Wikipedia: https://en.wikipedia.org/wiki/Partition_of_a_set | |
// Implementation of: https://stackoverflow.com/a/20530130 | |
// First, let's solve a simpler problem: how to find all partitions consisting of exactly two parts. | |
// For an n-element set, we can count an int from 0 to (2^n)-1. This creates every n-bit pattern, | |
// with each bit corresponding to one input element. If the bit is 0, we place the element in the | |
// first part; if it is 1, the element is placed in the second part. | |
// This leaves one problem: For each partition, we'll get a duplicate result where the two parts are | |
// swapped. To remedy this, we'll always place the first element into the first part. We then only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Requires: sudo apt install attr libglib2.0-bin xdotool | |
ATTR_IGNORED="com.dropbox.ignored" | |
ATTR_EMBLEMS="metadata::emblems" | |
EMBLEM_IGNORED="emblem-colors-red" | |
function ignore { |