Skip to content

Instantly share code, notes, and snippets.

@sprig
sprig / EmacsClient.applescript
Created March 31, 2016 06:52
Receive URLs or files and forward them to emacsclient in OSX.
set emacsclient to "/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9/emacsclient -n -c -a \"/Applications/Emacs.app/Contents/MacOS/Emacs\""
on open location input
do shell script emacsclient & "\"" & input & "\""
end open location
on open inputs
repeat with raw_input in inputs
set input to POSIX path of raw_input
do shell script emacsclient & "\"" & input & "\""
@sprig
sprig / setup-emacs-fonts.el
Created March 11, 2016 22:30
Config to set up nice fonts in emacs
(defun kk/setup-fonts (&rest args)
(interactive)
(set-face-font 'default "Source Code Pro for Powerline-11")
(set-fontset-font t 'hebrew (font-spec :name "Courier New-11"))
)
(advice-add 'server-create-window-system-frame :after 'kk/setup-fonts)
(advice-add 'server-create-tty-frame :after 'kk/setup-fonts)
(unless (daemonp) (kk/setup-fonts))
@sprig
sprig / Evernote_HTML_Downloader.js
Created January 11, 2016 21:57
Download entire page for selected notes, from the given URLs
var Evernote = Application("Evernote");
try
{
var newnotes = [];
var note, tags, tl, url, newNote, noteWindow;
var before = Evernote.tags.byName("foo");
var error = Evernote.tags.byName("bar");
var after = Evernote.tags.byName("baz");
@sprig
sprig / ignorelist
Last active August 29, 2015 14:24 — forked from rubo77/ignorelist
#These directories may be excluded:
# contains mounted file systems
.gvfs
.local/share/gvfs-metadata
# contains the actual encrypted home directory
.Private
# session-specific
.dbus
.cache
(setq kk/org-packages
'(
;; package kk/orgs go here
org
cdlatex
))
;; List of packages to exclude.
(setq kk/excluded-packages '())
@sprig
sprig / eval-list-symbol.el
Last active August 29, 2015 14:01
Why (eval (list 'symbol))
(setq testvar nil)
nil
(defmacro testmacro ()
(if testvar "OMG, I passed the test!")
(pp "I failed! damn!")))
testmacro
(setq test-simple (testmacro))
"I failed! damn!""\"I failed! damn!\""
@sprig
sprig / org-no-helm.el
Last active April 19, 2024 02:32
Advice for org-set-tags to disable helm completion
(defun kk/run-with-no-helm (orig-func &rest args)
"Run a function without helm completion."
(if (boundp 'helm-mode)
(let ((orig-helm-mode helm-mode))
(unwind-protect
(progn
(helm-mode 0)
(apply orig-func args)
)
(helm-mode (if orig-helm-mode 1 0))))
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME
VERSION=1.2.3
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
#!/usr/bin/env ruby
# encoding: utf-8
# == Synopsis
# Requires the terminal-notifier gem ([sudo] gem install terminal-notifier)
# growlnotify wrapper to turn Growl alerts into Mountain Lion notifications
# Uses growlnotify option syntax to keep your old scripts working with the new shiny.
#
# If you use Growl via growlnotify in your shell scripting, this script
# will replace Growl's alerts with Mountain Lion notifications.
@sprig
sprig / reflect.py
Created March 7, 2014 11:29 — forked from huyng/reflect.py
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):