Skip to content

Instantly share code, notes, and snippets.

View watter's full-sized avatar

Leslie H Watter watter

View GitHub Profile
@watter
watter / gist:5716566
Created June 5, 2013 19:32
moneylog emacs mode helper functions scratch
(defun mlog-almoco ()
(interactive)
(start-process "mount /media/Leslie"
(get-buffer-create "*mount-buffer*")
"/bin/mount"
"/media/Leslie")
(sleep-for 5)
(load-file "/media/Leslie/moneylog/moneylog.el")
(pop-to-buffer (find-file-noselect "/media/Leslie/moneylog/almoco.txt"))
(delete-other-windows)
@watter
watter / gist:5144466
Created March 12, 2013 16:36
how to get your tags from an org-mode file
$ egrep ":[a-zA-Z_-]+:" todo.org | grep '^*' | egrep -o ":[a-zA-Z_-:]+:+" | tr : '\n' | sort -u
@watter
watter / gist:5060067
Created February 28, 2013 20:57
script to verify md5 of a file built in hudson and deploy it manually simply and clean only transfer the file when md5 is different from the local one :D
#!/bin/bash
cd /tmp
rm /tmp/cas.*
echo `w3m -dump http://hudson.server/hudson/job/CAS/ws/target/cas.war/*fingerprint*/ 2> /dev/null | grep MD5: | cut -f 2 -d : | sed 's/^ //g'`" /opt/jboss-as-7.1.1/standalone1/deployments/cas.war" > /tmp/cas.md5
md5sum --status -c /tmp/cas.md5
if [ $? -eq 1 ]; then
@watter
watter / .htdocs
Created December 6, 2012 18:34
htdocs that adds DER mimetype to the current directory so firefox users can import easily a certificate
AddType application/x-x509-ca-cert der
AddType application/pkix-cert der
@watter
watter / i-link-trac-ticket
Created September 12, 2012 13:47
Function that inserts a link to our trac instalation depending on which server it is located
@watter
watter / merge-resourcespace-languages.sh
Last active September 30, 2015 11:27
Merge PHP internationalization Strings
#!/bin/bash
# I've got to merge some translated string from resourcespace into a new file.
# But... it's php with a sentence in a row, and every sentence was assigned to a position in a vector.
# So, the new en.php got seven hundred and something more strings than the pt-BR.php file. I've got to merge the translations into a new file which I could do the rest of the translation.
# The problem with this merge was that I didn't want to miss the comments of the original file.
# So I chose to do it by shell scripting ;-)