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 | |
gfxpf() { | |
git reset | |
for file in $(git ls-files --modified) | |
do | |
git add $file | |
git commit --fixup=$(git log -1 --pretty=format:%h $file) | |
done | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am caugner on github. | |
* I am claasaug (https://keybase.io/claasaug) on keybase. | |
* I have a public key ASBWqNBZQNznG4rKSKlkmZcRQBEMfA48b-Ygrdj9ychEHgo | |
To claim this, I am signing this object: |
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
### Keybase proof | |
I hereby claim: | |
* I am caugner on github. | |
* I am claasaug (https://keybase.io/claasaug) on keybase. | |
* I have a public key ASBQ69ueLmRHw5Gfg1Wg7p5CGAENouEwq5NzTszec0qRowo | |
To claim this, I am signing this object: |
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
prompt_hg() { | |
(( $+commands[hg] )) || return | |
local rev status | |
if $(hg root 2> /dev/null); then | |
if $(hg prompt >/dev/null 2>&1); then | |
if [[ $(hg prompt "{status|unknown}") = "?" ]]; then | |
# if files are not added | |
prompt_segment red white | |
st='±' | |
elif [[ -n $(hg prompt "{status|modified}") ]]; 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
<?php | |
/** | |
* Migrates Trac 0.10 attachments to 1.0 attachments. | |
* | |
* Based on: | |
* - https://trac.edgewall.org/browser/branches/1.0-stable/trac/upgrades/db28.py | |
* - https://trac.edgewall.org/browser/branches/1.0-stable/trac/attachment.py | |
*/ | |
if ($argc != 3) { | |
printf("USAGE: %s INPUT_DIR OUTPUT_DIR", $argv[0]); |
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
<?php | |
$file = isset($argv[1]) ? $argv[1] : null; | |
if (empty($file)) { | |
printf("USAGE: %s file.js", $argv[0]); | |
exit; | |
} | |
if (!is_file($file)) { | |
printf("ERROR: File does not exist: %s", $file); | |
} |
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
# Usage: | |
# $ cat file.tex | ruby latex-bracket-depth.rb | |
# $ echo "\textbf{ \textit{foobar} }" | ruby latex-bracket-depth.rb | |
# \textbf{1\111111{222222}1} | |
content = STDIN.read | |
len = content.size | |
level = 0 |
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 | |
# cac = commit-at-changetime | |
alias git-cac=git commit --date="$(git ls-files --modified | xargs stat | grep "Modify: " | sort | tail -1 | awk '{gsub("Modify: ", "", $0); print $0}')" |
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 | |
if (( $# != 3 )); then | |
echo "Usage: $0 ftp.example.com ftp-user ftp-password" | |
exit 1 | |
fi | |
SERVER=$1 | |
USER=$2 | |
PASS=$3 |
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
[Desktop Entry] | |
Version=1.0 | |
Name=Nightly | |
Exec=/opt/nightly/firefox %u | |
Icon=/opt/nightly/browser/icons/mozicon128.png | |
Terminal=false | |
Type=Application | |
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; | |
StartupNotify=true | |
Categories=Network;WebBrowser; |