Skip to content

Instantly share code, notes, and snippets.

View stefanschmidt's full-sized avatar

Stefan stefanschmidt

  • Hamburg, Germany
View GitHub Profile
@stefanschmidt
stefanschmidt / disable-tilde-autocomplete.sh
Last active August 29, 2015 13:56
Workaround to disable tilde autocomplete in Bash on Debian GNU/Linux 6.0
# even when the readline variable expand-tilde is set to off ~ gets replaced with the users directory
# to fix this erroneous behaviour add this to the end of your .bashrc (or upgrade to wheezy)
# tilde expansion is not affected by this so the tilde will still get replaced upon execution
__expand_tilde_by_ref()
{
return 0;
}
@stefanschmidt
stefanschmidt / beautify-gitlog.sh
Created March 2, 2014 21:18
Beautify git log
# found on Fred Schott's blog
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
@stefanschmidt
stefanschmidt / disable-last-login.sh
Last active August 29, 2015 13:57
Disable last login message in OS X / Linux shell
touch ~/.hushlogin
@stefanschmidt
stefanschmidt / disable-quora-login-nag.js
Last active August 29, 2015 14:00
Disable annoying Quora login request in Safari
/* approach from browser extension by Ameya Lokare */
/* for use with e.g. http://canisbos.com/quickscript */
function containsShare(url) {
return /[&\?]share=1/.test(url);
}
function addShare(url) {
if (url.indexOf('?') < 0) {
url += "?share=1";
@stefanschmidt
stefanschmidt / disable-tunnelbear-icon.sh
Created May 2, 2014 12:47
Disable Tunnelbear dock icon on OS X 10.9 Mavericks
/usr/libexec/PlistBuddy /Applications/TunnelBear.app/Contents/Info.plist -c "Add LSUIElement String"
/usr/libexec/PlistBuddy /Applications/TunnelBear.app/Contents/Info.plist -c "Set LSUIElement 1"
sudo codesign -f -s - /Applications/TunnelBear.app
@stefanschmidt
stefanschmidt / hide-mathjax-progress.css
Last active August 29, 2015 14:02
Hide annoying MathJax progress indicator
/* supposingly a more proper way would be to configure the showProcessingMessages option*/
/* for use with e.g. http://code.grid.in.th */
div#MathJax_Message {
display: none !important;
}
@stefanschmidt
stefanschmidt / net.foobar.webloc.plist
Last active August 29, 2015 14:02
Launch agent to repair webloc files with missing icon
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.foobar.webloc</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
@stefanschmidt
stefanschmidt / hide-notifications.css
Created June 13, 2014 19:00
Hide annoying notification indicator on Wikipedia et al
/*
for use with e.g. http://code.grid.in.th
url patterns to include:
https://*.wikipedia.org/*
https://*.wiktionary.org/*
https://*.wikiquote.org/*
https://*.wikibooks.org/*
https://commons.wikimedia.org/*
*/
@stefanschmidt
stefanschmidt / world-cup-ticker.sh
Created June 22, 2014 01:09
ARD soccer world cup ticker in terminal window
# watch requires unicode patch to work properly: https://launchpad.net/debian/+source/procps/1:3.2.8-3
watch -tn 10 'w3m http://www1.sportschau.de/sportschau_specials/layout/php/ticker/index.phtml?tid=2387 | tail -n+15'
@stefanschmidt
stefanschmidt / download-dropbox.sh
Last active August 29, 2015 14:04
Download Dropbox application without using the graphical installer on OS X
wget --content-disposition "https://www.dropbox.com/download?plat=mac&full=1"