Skip to content

Instantly share code, notes, and snippets.

@lewang
lewang / anything-config.el.diff
Created January 1, 2012 03:30
patch for anything-config.el fix anything-regexp issue with folded text
diff --git a/anything-config.el b/anything-config.el
index dbfdcd0..abfa1e8 100644
--- a/anything-config.el
+++ b/anything-config.el
@@ -2149,15 +2149,22 @@ Default is `anything-current-buffer'."
(defun anything-region-active-p ()
(and transient-mark-mode mark-active (/= (mark) (point))))
-(defun anything-goto-line (lineno)
- "Goto LINENO opening only outline headline if needed."
@lewang
lewang / org.el.diff
Created January 27, 2012 14:36
org-mode patch for better C-u C-c C-w completion
diff --git a/lisp/org.el b/lisp/org.el
index 7a68b73..ccdcace 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10625,7 +10625,8 @@ prefix argument (`C-u C-u C-u C-c C-w')."
(t (concat "Refile subtree \""
heading-text "\" to")))
default-buffer
- org-refile-allow-creating-parent-nodes
+ (and (not (equal '(4) goto))
@lewang
lewang / gist:1702723
Created January 30, 2012 05:27
emacs crash "gdb where"
(gdb) r
Starting program: /Users/lewang/src/emacs/nextstep/intel64/Emacs.app/Contents/MacOS/Emacs --
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000000101e0
0x00000001000ce85f in unchain_marker (marker=0x1098bc490) at marker.c:735
735 tail = BUF_MARKERS (b);
(gdb) where
@lewang
lewang / gist:1833599
Created February 15, 2012 05:50
show all jQuery events bound to element
// usage: $("a.connectoin_action").getAllHandlersFor("click")
$.fn.getAllHandlersFor = function (event) {
var results = [],
$orig = $(this),
$next,
handlers;
handlers = $orig.data("events") && $orig.data("events")[event];
@lewang
lewang / gist:1901000
Created February 24, 2012 13:38
make "<>" not matching delimiters in html-mode
(eval-after-load "sgml-mode" '(progn
(modify-syntax-entry ?< "_" sgml-mode-syntax-table)
(modify-syntax-entry ?> "." sgml-mode-syntax-table)))
@lewang
lewang / tmux-zoom
Created March 28, 2012 15:49
tmux zoom and unzoom pane into its window. Can have multiple panex zoomed in at once
#!/usr/bin/ruby
# INSTALL:
#
# 1. Make script executable and put it in your $PATH
#
# 2. add to ~/.tmux.conf
#
# bind + run tmux-zoom
#
@lewang
lewang / wkhtmltopdf.rb
Created August 21, 2012 09:56 — forked from 2bits/wkhtmltopdf.rb
wkhtmltopdf - build formula for Homebrew supporting 0.9.9, 0.11.0_rc1, and their patched Qt4
require 'formula'
class WkhtmltopdfQt < Formula
# This is the latest staging branch commit, dated 6 JAN 2012.
url 'https://qt.gitorious.org/qt/wkhtmltopdf-qt/archive-tarball/6053b687d24956d0a7eac21a015172b29cf0f451'
sha1 'c8217e7a96d5e63cb6b2334d5eefe866d06acfde'
version '6053b68'
end
class Wkhtmltopdf < Formula
@lewang
lewang / scroll-in-place-emacs.el
Created September 10, 2012 11:22
scroll-in-place
;;;; -*-Emacs-Lisp-*- Improved Vertical Scrolling Commands
;;;; Written by Eric Eide, last modified on 1994/11/18 21:23:01.
;;;; (C) Copyright 1993, 1994, Eric Eide and the University of Utah
;;;;
;;;; COPYRIGHT NOTICE
;;;;
;;;; This program is free software; you can redistribute it and/or modify it
;;;; under the terms of the GNU General Public License as published by the Free
;;;; Software Foundation; either version 2 of the License, or (at your option)
@lewang
lewang / ruby.rb.diff
Created September 14, 2012 02:46
gettext continue after error (patch for 2.2.0, whitespace changes ignored
diff -b -B -u /Users/lewang/tmp/ruby.old.rb /Users/lewang/.rvm/gems/ree-1.8.7-2012.02\@agworld-3.2/gems/gettext-2.2.0/lib/gettext/tools/parser/ruby.rb
--- /Users/lewang/tmp/ruby.old.rb 2012-09-14 10:43:38.000000000 +0800
+++ /Users/lewang/.rvm/gems/ree-1.8.7-2012.02@agworld-3.2/gems/gettext-2.2.0/lib/gettext/tools/parser/ruby.rb 2012-09-13 15:49:30.000000000 +0800
@@ -18,7 +18,9 @@
module GetText
class RubyLexX < RubyLex # :nodoc: all
# Parser#parse resemlbes RubyLex#lex
- def parse
+ def parse(path = nil, lines = [])
+ tk = nil
@lewang
lewang / ember-20121002.js
Created October 3, 2012 07:57
ember 20121002
// Version: v1.0.pre-160-g7d62790
// Last commit: 7d62790 (2012-09-26 15:59:36 -0700)
(function() {
/*global __fail__*/
/**
Ember Debug