This file contains hidden or 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
// ==UserScript== | |
// @name XKCD with publish dates | |
// @author MichD | |
// @include /^https?://xkcd.com.*$/ | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function pad(text) { | |
return (text.length < 2 ? "0" : "") + text; |
This file contains hidden or 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 | |
# This script collects files in a media folder and presents them in a dialog, | |
# where you can select one with arrow keys and enter. It is then played with | |
# omxplayer. | |
# The script allows navigating into subdirectories, and back up as well. Spaces | |
# in file names should also work properly. | |
# Assumptions: | |
# - `whiplash` is installed. `dialog` is an alternative, but it didn't work well |
This file contains hidden or 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
#include <ncurses.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include "snake.h" | |
#define SNAKE_BOX_W 32 | |
#define SNAKE_BOX_H 16 | |
#define SNAKE_LOCATIONS (SNAKE_BOX_W * SNAKE_BOX_H) | |
#define INITIAL_SNAKE_LENGTH 5 |
This file contains hidden or 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
# Usage: | |
# $ radio <network> <channel-key> | |
# Where network is a network key as specified in http://api.audioaddict.com/v1/networks | |
# and where channel-key is the name of a channel as seen in a channel page URL | |
# The script will ask for a listen key and save it in ~/.listen_key if you don't | |
# have one on file yet. | |
radio() { | |
# Modify playCmd to launch the stream with a different player | |
local playCmd="mplayer " | |
local network=$1 |
This file contains hidden or 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
# Return current git branch prefixed with |, nothing if not in git repo | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\|\1/' | |
} | |
# Returns some "dirty" flags if they apply, nothing if not in git repo, | |
# or current branch is clean. | |
# Flags: M = modified files, ? = untracked files, % = unresolved merges | |
# These flags are prefixed with a | | |
parse_git_dirty() { |
This file contains hidden or 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
loadJSON({ | |
"lorem": "Lorem ipsum dolor sit amet", | |
"consectetur": "adipisicing elit, laboris, adipisicing dolores nulla tempore cupidatat" | |
}); |
This file contains hidden or 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
(function () { | |
"use strict"; | |
/** | |
* Iterate over an Object, Array of String with a given callBack function | |
* | |
* @param {Object|Array|String} collection | |
* @param {Function} callBack | |
* @return {Null} | |
*/ |