Skip to content

Instantly share code, notes, and snippets.

@baron
baron / 20130320_14231363757019_legal_system.utf
Created March 20, 2013 05:38
Thought Experiment on the American Legal System
@baron
baron / gist:1102664
Created July 24, 2011 14:19
Blogging engine for hackers for hackers
# engine goes here
testing
@baron
baron / gist:971587
Created May 14, 2011 01:45
Improved Calibre Economist Recipe
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
'''
economist.com
'''
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.ebooks.BeautifulSoup import Tag, NavigableString
<a href="http://b.hatena.ne.jp/entry/http://www.pixelmotion.co.uk/designersforjapan/" class="hatena-bookmark-button" data-hatena-bookmark-title="designersforjapan" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script>
<iframe src="http://share.gree.jp/share?url=http%3A%2F%2Fwww.pixelmotion.co.uk%2Fdesignersforjapan%2F&type=0&height=20" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" style="border:none; overflow:hidden; width:100px; height:20px;" allowTransparency="true"></iframe>
<iframe src="http://www.facebook.com/plugins/like.php?app_id=145508218853594&amp;href=http%3A%2F%2Fwww.pixelmotion.co.uk%2Fdesignersforjapan%2F&amp;send=true&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;action=like&amp;col
@baron
baron / magit
Created March 24, 2011 11:25
commit and push in one go
(defun magit-commit-then-push ()
(interactive)
(progn
(magit-log-edit-commit)
(magit-push)))
@baron
baron / gist
Created March 23, 2011 00:05
gist
(defun force-git-add-after-el-get (package-path)
(let* ((git-executable (el-get-executable-find "git"))
(name (format "*git add subdir %s*" package)) )
(message (format "cd %s && %s add %s/" el-get-dir git-executable package-path))
(shell-command (format "cd %s && %s add %s/" el-get-dir git-executable package-path))))
(add-hook 'el-get-post-install-hooks 'force-git-add-after-el-get)
(add-hook 'el-get-post-update-hooks 'force-git-add-after-el-get)
@baron
baron / gist:867129
Created March 12, 2011 08:20
Compiling Emacs 23 with Xcode 4
#you need to do it from source
bzr branch http://bzr.savannah.gnu.org/r/emacs/emacs-23 emacs-23
cd emacs-23
./configure --with-ns --without-x
make bootstrap
make
make install
open nextstep/Emacs.app
@baron
baron / emacs-inline.patch
Created March 3, 2011 04:55
inline patch revised for cocoa emacs
diff -p -N -r -x '*.elc' ../emacs-23.1.95/lisp/term/ns-win.el lisp/term/ns-win.el
*** ../emacs-23.1.95/lisp/term/ns-win.el 2010-03-11 11:20:29.000000000 +0900
--- lisp/term/ns-win.el 2010-04-03 21:49:10.000000000 +0900
*************** The properties returned may include `top
*** 315,320 ****
--- 315,321 ----
(cons (logior (lsh 0 16) 12) 'ns-new-frame)
(cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar)
(cons (logior (lsh 0 16) 14) 'ns-show-prefs)
+ (cons (logior (lsh 0 16) 15) 'mac-change-input-method)
(require 'google)
(defalias 'g 'google-code)
(defun ib ()
"indent whole buffer"
(interactive)
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max)))