Skip to content

Instantly share code, notes, and snippets.

@commonquail
commonquail / mdpp.md
Last active August 28, 2015 04:38
Idea for a Markdown preprocessor

Idea for a Markdown preprocessor

Feature master list:

  • Table of contents
    • {{toc}}?
    • ATX headers
    • two-pass processing for consistent stream
    • Ignore # in code blocks, quotes
  • File transclusion
@commonquail
commonquail / .blockify_list
Last active August 29, 2015 14:08
Blockify company name list for https://github.com/mikar/blockify
AAU
Artpeople
betsafe.com
Bose
Digster
disco:wax
Dr. Oetker
Filtr
Finetunes
FRESH LIGE NU
@commonquail
commonquail / unattended-upgrades.md
Last active August 29, 2015 14:16
Unattended upgrades for Linux Mint 17.1

Based on [this guide by Andew Bolster, 2015-02-06][guide]; reposted for posterity and to address a minor awk field separator oddity.

Install unattended-upgrades:

$ sudo apt-get install unattended-upgrades -y

unattended-upgrades writes to the log file

@commonquail
commonquail / gear.md
Last active August 29, 2015 14:18
Cinnamon's smaller menu gear icon.

For unknown reasons I keep having to reset this. Now, additionally, the only relevant Google result leads to a GitHub issue that unfortunately points to a file on the master branch that has since been moved. Here are the direct links to the files.

Note that this icon has been changed in a later version. The newer version seems to be slightly larger. I dislike it, so this is the original gear.

@commonquail
commonquail / java-files-with-no-declared-constructors.sh
Created April 13, 2015 11:58
Find Java files with no declared constructors
# These two commands both search the working directory
# for java class files that do not declare a constructor.
#
# The first command is marginally faster than the second;
# for truly large code bases, this may matter,
# but mostly it won't.
#
# The commands disregard package-info.java and tests.
# #1: Finds all files in the first pass,
@commonquail
commonquail / README.md
Last active August 29, 2015 14:24
Notes for filtering IPVanish servers

Server list at https://www.ipvanish.com/api/servers.geojson

No CORS. Copy the JavaScript functions below into the console and confirm. Copy all the (JSON) output in the browser window into the console, into a variable named e.g. everything. Copy the final line, then play arround with the all array.

@commonquail
commonquail / commit-msg-stats.sh
Created August 4, 2015 12:01
Very simple commit message stats
#!/bin/bash
set -o errexit
set -o nounset
[[ $# -eq 1 ]] || {
echo "usage: $0 <author>"
exit 1
}
@commonquail
commonquail / spot.sh
Created August 4, 2015 12:02
Start Spotify and Blockify from the command line if either is not running
#!/bin/bash
set -o errexit
if ! ps -e | grep -q spotify
then
spotify > /dev/null 2>&1 &
fi
if ! ps -e | grep -q blockify-ui

The following command generates a 20 character password from all visible ASCII characters (94) except '"|\ (90), which are problematic in some contexts, like embedding in (unversioned) source code, for approximately [128 bits of entropy (9020 = 1.22e+39)][math]:

$ < /dev/urandom tr -dc [:graph:] | tr -d \|\\\'\\\\\" | head -c20 | xsel --clipboard 
@commonquail
commonquail / find-skip-vcs-directories.md
Last active August 31, 2015 11:52
Skip VCS directories with find

This command recursively finds every file matching the glob pattern *.* (name.extension) in the working directory, excluding child directories whose names start with ..

This is useful for skipping various VCS directories, for instance.

find . -type d -path './.*' -prune -o -type f -name '*.*' -print