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
RED="0;31m" | |
function cg { | |
CG=$(git rev-parse --show-toplevel 2> /dev/null) | |
if [ $? -eq 0 ] && [ -d "$CG" ]; then | |
cd "$CG" || echo "\033[${RED}WARNING: Could not cd to top directory of git repository\033[00m" | |
else | |
echo -e "\033[${RED}WARNING: Not in a git repository\033[00m" | |
fi | |
} |
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
\def\cmnt#1{} | |
\cmnt{ | |
% This is the default.latex file from Pandoc with a single change: I | |
% have added the fontspec, xunicode, and xltxtra packages to the | |
% fontenc invocation. This change allows you to use your Truetype and | |
% Opentype fonts with pandoc and make your markdown even prettier than | |
% ever. Example usage: | |
% | |
% pandoc recipe.md --pdf-engine=xelatex --template=truetype.latex -V mainfont="Centaur MT Std" -o recipe.pdf |
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 perl | |
# RN | |
# | |
# `rn` is a bulk renaming script for the Linux filesystem. It takes a | |
# single transformation argument followed by a list of filenames. The | |
# transformation argument must be a perl expression, but most of the | |
# time that amounts to a simple regular expression. | |
# | |
# Examples: |
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 bash | |
LOCATE=$(command -v locate) | |
if [ -z "$LOCATE" ]; then | |
echo "The program 'locate' is not available. Cannot determine location of steam install." | |
exit 1 | |
fi | |
STEAMS=$(locate compatdata | grep steam | sed 's/\(steam.*compatdata\).*$/\1/' | sort | uniq | wc -l) | |
if [ "$STEAMS" -eq 0 ]; then |
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
/* | |
Microsoft elder Robert Martin, aka "Uncle Bob," has a long series of | |
videos where he lectures on the joys and benefits of object oriented | |
programming. One thing he likes to say over and over is that your | |
data should not be tied up by the choice of representation, and that | |
the most problematic of all data representations is the choice of a | |
database far too early in the development process. | |
In his presentation on the Single Responsibility Principle (which I |
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 hy | |
; As quick and dirty as it gets. Tested on hy 0.17 | |
; [hy](http://docs.hylang.org/en/stable/index.html) | |
(require [hy.extra.anaphoric [ap-each ap-reduce ap-map ap-filter]]) | |
(require [hy.contrib.walk [let]]) | |
(import json os) | |
(defn file-list [] |
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
.PHONY: default help | |
default: help | |
help: ## Print this help message | |
@M=$$(perl -ne 'm/^((\w|-)*):.*##/ && print length($$1)."\n"' Makefile | \ | |
sort -nr | head -1) && \ | |
perl -ne "m/^((\w|-)*):.*##\s*(.*)/ && print(sprintf(\"%s: %s\t%s\n\", \$$1, \" \"x($$M-length(\$$1)), \$$3))" Makefile | |
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
{-# START_FILE package.yaml #-} | |
name: {{name}} | |
version: 0.1.0.0 | |
homepage: https://github.com/{{github-username}}{{^github-username}}githubuser{{/github-username}}/{{name}}#readme | |
license: MPL-2.0 | |
license-file: LICENSE.md | |
author: {{author-name}}{{^author-name}}Author name here{{/author-name}} | |
maintainer: {{author-email}}{{^author-email}}example@example.com{{/author-email}} | |
copyright: {{copyright}}{{^copyright}}{{year}}{{^year}}2019{{/year}} {{author-name}}{{^author-name}}Author name here{{/author-name}}{{/copyright}} |
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 python3 | |
# TUMBLON | |
# | |
# With Tumblr shutting down, I wanted to at least keep some semblance | |
# of the experience of Tumblr around. Since I was able to download | |
# all of my tumblr blogs into separate local repos thanks to | |
# Beat Bolli's wonderful tumblr_backup tool | |
# (https://github.com/bbolli/tumblr-utils/blob/master/tumblr_backup.md), | |
# I just wanted it to spit out a few random images everyday I could |
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 python3 | |
# GIT-RBAGO | |
# | |
# For any given git repository, this script will print out the | |
# (default) ten _most recently worked on_ branches, along with a | |
# fairly human-readable version of how long ago that was. | |
# | |
# Example: | |
# |