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/sh | |
:<<'=cut' | |
=head1 NAME | |
git-wrapper - avoid committing as you@invalid | |
=head1 SYNOPSIS |
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/sh | |
:<<'=cut' | |
=head1 NAME | |
traceback - make a shell command show a call trace on failure | |
=head1 SYNOPSIS |
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
<html> | |
<head><title>Matkahuolto Bookmarklet</title></head> | |
<body> | |
<h1>Bookmarklet Test</h1> | |
<p> | |
The unobvious part was that %C5bo in the query parameters had to be escaped as %25C5bo before this would work. | |
Symptoms in Firefox were that the Javascript became visible in the location bar but nothing happened. | |
</p> | |
<code> var d=new Date(); | |
location.href='http://www.matkahuolto.info/lippu/sv/connectionsearch?stat=1' + |
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
# Source this file | |
bak () { | |
# "local" is a Bashism -- comment out for POSIX | |
local f | |
for f; do | |
test -e "$f~" && bak "$f~" | |
mv "$f" "$f~" | |
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
#!/usr/bin/env python | |
# http://stackoverflow.com/questions/29264036/how-to-properly-escape-within-nested-parentheses-and-brackets | |
import urllib | |
import re | |
def tests (): | |
"""Download test suite; return a list of addresses to test with.""" | |
tests_url = 'http://code.iamcal.com/php/rfc822/tests/tests.xml' |
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
xubuntu 14.04 live CD: location Ireland; Swedish keyboard | |
user era, password ... that one | |
install && reboot | |
reset download preference in Software & Updates to tut.fi | |
sudo apt-get install aptitude | |
-- https://github.com/CERNatschool/getting-started/wiki/Creating-a-Xubuntu-14.04-Virtual-Machine-with-VirtualBox | |
sudo aptitude install dkms | |
install virtualbox guest additions -- | |
-- https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/327362/comments/24 | |
update /etc/default/avahi-daemon -- AVAHI_DAEMON_DETECT_LOCAL=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
(defun renumber-tables (n m) | |
"Renumber remaining tables starting with index N, adjust by M. | |
For example, `(renumber-tables 3 -1)` will renumber \"Table 3\" to | |
\"Table 2\", \"Table 4\" to \"Table 3\", etc." | |
(interactive "NStart at: \nNAdjust: ") | |
(save-excursion | |
(save-match-data | |
(while (re-search-forward "Table \\([1-9][0-9]*\\)" nil t) | |
(let ((i (string-to-number (match-string-no-properties 1)))) | |
(when (>= i n) |
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
;; http://emacs.stackexchange.com/questions/7734/why-are-leading-spaces-colored-before-comments-in-makefile-mode | |
(setq makefile-font-lock-keywords | |
(delq (assoc "^\t+#" makefile-font-lock-keywords) | |
makefile-font-lock-keywords)) |
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
# Add this to your .bash_profile or similar | |
activate () | |
{ | |
test -d "$1" && test -r "$1/bin/activate" && . "$1/bin/activate" && return; | |
echo "activate: $1 does not look like a valid virtualenv" 1>&2; | |
return 1 | |
} |
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
screentitle () { printf '\033k%s\033\' "$*"; } |
OlderNewer