Skip to content

Instantly share code, notes, and snippets.

@JPvRiel
JPvRiel / apt_pinning_priorities.md
Last active June 1, 2024 09:56
Apt package pinning and priorities
@adamhotep
adamhotep / longopts2getopts.sh
Last active November 29, 2023 23:22
POSIX shell: support long options by converting them to short options
# a refinement of https://stackoverflow.com/a/5255468/519360
# see also my non-translating version at https://stackoverflow.com/a/28466267/519360
# translate long options to short
reset=true stopped=""
for opt in "$@"; do
if [ -n "$reset" ]; then
unset reset
set -- # reset the "$@" array so we can rebuild it
fi
#!/bin/sh
usage()
{
echo "Usage:"
echo " dump <file|image|text> [file] [language]"
echo " dump [file]"
}
_type="$1"
@alexlangberg
alexlangberg / dunstrc
Created May 27, 2015 22:19
Settings for dunst notifications. Colors from FlatStudio GTK theme (dark). Place in ~/.config/dunst/
[global]
font = Ubuntu 10
# Allow a small subset of html markup in notifications and formats:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
@RogerDodger
RogerDodger / md2bbc.pl
Last active December 8, 2020 21:05
Converts Markdown to BBCode
#!/usr/bin/env perl
use strict;
use warnings;
use 5.01;
use Text::Markdown;
use Encode;
use HTML::Entities;
use Getopt::Long;
@AliMD
AliMD / gist:3344523
Created August 13, 2012 22:28
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

@ccschmitz
ccschmitz / ST2 Multiple Cursor Keybindings.md
Created August 11, 2012 18:33
Create keybindings for multiple cursors in Sublime Text

Create Multiple Cursors from the Keyboard in Sublime Text

The following keybindings will allow you to create multiple cursors (above or below the current cursor) with Command + Option + (Up|Down). On Windows it would be Control + Alt + (Up|Down).

{ "keys": ["super+alt+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["super+alt+down"], "command": "select_lines", "args": {"forward": true} }
#!/bin/sh
usage()
{
echo "Usage: dump <file|image|text> [file] [language]"
}
case $1 in
file)
URL=`curl -w %{redirect_url} -F "file=@$2" http://dump.bitcheese.net/upload-file?simple`