Skip to content

Instantly share code, notes, and snippets.

define dump_emacs_bt
set $t = backtrace_list
while $t
print *(struct Lisp_String *)(((struct Lisp_Symbol *)(*($t->function)-2))->xname -1)
set $t = $t->next
end
end
document dump_emacs_bt
dumps the current frame stack. usage: dump_emacs_bt
--
-- Toggle AirPort.scpt
--
-- Author: Andrew Heiss - http://www.andrewheiss.com
-- Project site: http://github.com/andrewheiss/AirPort-Toggle
-- Description: Toggle AirPort.scpt is a simple AppleScript file that will
-- either enable or disable your AirPort connection
-- License: Licensed under the MIT License (see README for full information)
-- Date: November 4, 2009
-- Version: 1.0
#!/usr/bin/env perl
use List::Util qw(first);
while(1){
if (first { /\Q100.0% packet loss\E/ } `ping -W 1 -c 3 192.168.0.1`) {
`osascript ~/config/bin/toggle-air-mac.scpt`;
`osascript ~/config/bin/toggle-air-mac.scpt`;
}
sleep(10);
}
#!/usr/bin/env perl
use List::Util qw(first);
while(1){
if (first { /\Q100.0% packet loss\E/ } `ping -W 1 -c 3 192.168.0.1`) {
`osascript ~/config/bin/toggle-air-mac.scpt`;
`osascript ~/config/bin/toggle-air-mac.scpt`;
}
sleep(10);
}
(require 'mo-git-blame)
(setq mo-git-blame-blame-window-width 80)
;; format of blame
(defun mo-git-blame-process-filter-process-entry (entry)
(with-current-buffer (plist-get mo-git-blame-vars :blame-buffer)
(save-excursion
(let ((inhibit-read-only t)
(info (format "%s (%-8s %s %s) %s"
(substring (symbol-name (plist-get entry :hash)) 0 8)
(let ((author (plist-get entry :author))) (substring author 0 (min 8 (length author))))
@mechairoi
mechairoi / gist:1039965
Created June 22, 2011 12:28
exuberant ctags patch mysql modoki
diff --git a/sql.c b/sql.c
index efe7e5d..b7e21f2 100644
--- a/sql.c
+++ b/sql.c
@@ -319,13 +319,13 @@ static boolean isIdentChar1 (const int c)
* identifier, so we are removing some restrictions.
*/
return (boolean)
- (isalpha (c) || c == '@' || c == '_' );
+ (isalpha (c) || c == '@' || c == '_' || c == '`' );
# SEE ALSO Devel::TraceLoad::Hook
# %INCにちゃんともとのパスが入ってるのはなんでだろう?
package Hook::EndOfRequire;
use warnings;
use strict;
use Carp qw( croak );
use Exporter::Lite;
use Module::Locate qw( get_source );
use B::Hooks::EndOfScope;
(anything-c-arrange-type-attribute 'buffer
'((candidate-transformer REST
anything-c-highlight-buffers)
(display-to-real anything-my-get-buffer REST)))
(defun anything-my-get-buffer (buffer-or-filename)
(if (bufferp buffer-or-filename)
buffer-or-filename
(get-file-buffer buffer-or-filename)))
@mechairoi
mechairoi / zenburn.itermcolors
Created June 14, 2011 12:49
zenburn.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.50196081399917603</real>
<key>Green Component</key>
<real>0.56470590829849243</real>
;; centering source code window
(defadvice gud-display-line (after gud-dsplay-line-recenter activate)
(let* ((buffer
(with-current-buffer gud-comint-buffer
(gud-find-file (ad-get-arg 0))))
(window (and buffer
(or (get-buffer-window buffer)
(if (memq gud-minor-mode '(gdbmi gdba))
(or (if (get-buffer-window buffer 'visible)
(display-buffer buffer nil 'visible))