Skip to content

Instantly share code, notes, and snippets.

@irq0
irq0 / screenrc
Created July 3, 2012 21:30
weechat.conf
# Remove some stupid / dangerous key bindings
bind ^k
#bind L
bind ^\
# Make them better
bind \\ quit
bind K kill
bind I login on
bind O login off
bind } history
@irq0
irq0 / setup-flymake-for-java.el
Created September 14, 2012 18:30
emacs: java flymake, runtime syntax check with cedet
;; Dependencies: ecj (in MacPorts), ede project for the file, cedet development version (from bzr)
(require 'flymake)
(defvar flymake-java-version "1.6")
(defun flymake-java-ecj-init ()
(flymake-simple-make-init-impl
'flymake-create-temp-with-folder-structure nil nil
(file-name-nondirectory buffer-file-name)
@irq0
irq0 / org-mail-todo.py
Created November 6, 2012 21:04
Script to capture org-mode TODOs from mutt
?? build/
#!/usr/bin/env python
import sys
import email.parser
from subprocess import call
import urllib
def make_org_link(**kwargs):
return "[[{link}][{title}]]".format(**kwargs)
TXTBLK='\e[0;30m' # Black - Regular
TXTRED='\e[0;31m' # Red
TXTGRN='\e[0;32m' # Green
TXTYLW='\e[0;33m' # Yellow
TXTBLU='\e[0;34m' # Blue
TXTPUR='\e[0;35m' # Purple
TXTCYN='\e[0;36m' # Cyan
TXTWHT='\e[0;37m' # White
BLDBLK='\e[1;30m' # Black - Bold
BLDRED='\e[1;31m' # Red
@irq0
irq0 / fireplace
Created December 11, 2013 00:51
Play a nice fireplace video on XBMC
#!/bin/bash
xbmc_play_url $(youtube-dl -g $(youtube_search.py fireplace hd | sort -R | cut -f1 -d " " | head -1))
{:user {:plugins [[lein-ancient "0.5.4"]
[lein-ritz "0.7.0"]]
:repl-options {:nrepl-middleware [io.aviso.nrepl/pretty-middleware
inspector.middleware/wrap-inspect
ritz.nrepl.middleware.javadoc/wrap-javadoc
ritz.nrepl.middleware.apropos/wrap-apropos]}
:dependencies [[spyscope "0.1.4"]
[org.clojure/tools.namespace "0.2.4"]
#!/bin/bash
URL="http://doxieflashair.local"
DIRS="/DCIM/100DOXIE"
list () {
curl -s "${URL}/command.cgi?op=100&DIR=${1}" \
| awk 'BEGIN { FS=","; OFS="/" } /.+,(.+,){3}/ { print $1,$2 }'
}
*.xml diff=xml
*.png diff=exif
*.xml2 diff=xml
@irq0
irq0 / gist:c176fbdd0c3889c16093
Created July 31, 2014 15:16
.lein/profiles.clj
{:user {:plugins [[lein-ancient "0.5.5"]
[lein-ritz "0.7.0"]]
:repl-options {:nrepl-middleware [io.aviso.nrepl/pretty-middleware
cider.nrepl.middleware.inspect/wrap-inspect
cider.nrepl.middleware.classpath/wrap-classpath
cider.nrepl.middleware.complete/wrap-complete
cider.nrepl.middleware.info/wrap-info
cider.nrepl.middleware.inspect/wrap-inspect
cider.nrepl.middleware.macroexpand/wrap-macroexpand
@irq0
irq0 / attach_image.py
Last active August 29, 2015 14:05
rss2email post-processor: Attach images
import re
import requests
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
URL_REGEX = re.compile(r"""((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.‌​][a-z]{2,4}/)(?:[^\s()<>]+|(([^\s()<>]+|(([^\s()<>]+)))*))+(?:(([^\s()<>]+|(‌​([^\s()<>]+)))*)|[^\s`!()[]{};:'".,<>?«»“”‘’]))""", re.DOTALL)
def fetch_img(url):
result = None