Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan stefanschmidt

View GitHub Profile
@stefanschmidt
stefanschmidt / disable-tilde-autocomplete.sh
Last active Aug 29, 2015
Workaround to disable tilde autocomplete in Bash on Debian GNU/Linux 6.0
View disable-tilde-autocomplete.sh
# 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;
}
View beautify-gitlog.sh
# 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 Aug 29, 2015
Disable last login message in OS X / Linux shell
View disable-last-login.sh
touch ~/.hushlogin
@stefanschmidt
stefanschmidt / disable-quora-login-nag.js
Last active Aug 29, 2015
Disable annoying Quora login request in Safari
View disable-quora-login-nag.js
/* 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
Disable Tunnelbear dock icon on OS X 10.9 Mavericks
View disable-tunnelbear-icon.sh
/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 Aug 29, 2015
Hide annoying MathJax progress indicator
View hide-mathjax-progress.css
/* 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 Aug 29, 2015
Launch agent to repair webloc files with missing icon
View net.foobar.webloc.plist
<?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 Jun 13, 2014
Hide annoying notification indicator on Wikipedia et al
View hide-notifications.css
/*
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 Jun 22, 2014
ARD soccer world cup ticker in terminal window
View world-cup-ticker.sh
# 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 Aug 29, 2015
Download Dropbox application without using the graphical installer on OS X
View download-dropbox.sh
wget --content-disposition "https://www.dropbox.com/download?plat=mac&full=1"