Skip to content

Instantly share code, notes, and snippets.

--- highlight-indentation.el 2012-01-30 00:21:47.921213987 +0900
+++ highlight-indentation.el.mod 2012-01-30 00:21:40.649213762 +0900
@@ -46,8 +46,14 @@
on spaces"
:lighter " ||"
(when highlight-indentation-current-regex ;; OFF
- (font-lock-remove-keywords nil `((,highlight-indentation-current-regex
- (1 'highlight-indentation-face)))))
+ (font-lock-remove-keywords nil `(("^ +"
+ (,highlight-indentation-current-regex
;; reqpen-recent-closed-file
(defvar recent-closed-files nil)
(defun collect-recent-closed-files ()
(when buffer-file-name
(push buffer-file-name recent-closed-files)))
(add-hook 'kill-buffer-hook 'collect-recent-closed-files)
(defun reopen-recent-closed-file ()
(interactive)
(when recent-closed-files
(let (path)
@snj14
snj14 / permutation & combination
Created January 29, 2009 12:58
permutation & combination
function permutation(array){
return array.reduce(function(prev,current){
var res = [];
prev.forEach(function(pe){
if(!pe['length']) pe = [pe];
return current.forEach(function(ce){
res.push(pe.concat([ce]))
})
})
return res
@snj14
snj14 / RDF.js
Created November 22, 2008 15:21
RDF Query library for firefox extension
// this is library for RDF
// usage:
//
// var rdf = RDF("chrome://hoge/content/test.rdf"); // note: this is synchronous. not asynchronous.
//
// rdf.getAsXML() // => "<xml>....</xml>"
//
// rdf.query()
// .prefix({
@snj14
snj14 / gist:11848
Created September 21, 2008 07:10
log
// this function works on firefox extension.
function log(){
const Ci = Components.interfaces;
const Cc = Components.classes;
function firebug(method, args){
var windowManager = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator);
var win = windowManager.getMostRecentWindow("navigator:browser");
if(win.FirebugConsole && win.FirebugContext) {
@snj14
snj14 / MultiStrokeShortcutKey.js
Created September 21, 2008 06:58
MultiStrokeShortcutKey.js
// this is shortcut key library that multi stroke key support.
// this library depends on Arrow.js [ http://github.com/motemen/arrow-js/wikis ]
// Key
// 文字列で定義されたショートカットキーとキーイベントの差を吸収して比較できるようにする
function Key(aObject){return (this instanceof Key) ? this.init(aObject) : new Key(aObject)};
// test function
Key.Test = function(){
@snj14
snj14 / gist:6981
Created August 24, 2008 12:24
XHR
// XHR -- XMLHttpRequest
// Argmunets
//
// url
// method
// data
// headers
// Accept
// Referer
@snj14
snj14 / gist:3877
Created August 4, 2008 11:56
SBM Count With Google
// ==UserScript==
// @name SBM Count With Google
// @namespace http://white.s151.xrea.com/
// @description show SBM count in Google search result
// @include http://www.google.*/*q=*
// ==/UserScript==
// by snj14
// Cc-by http://creativecommons.org/licenses/by/2.1/jp/
@snj14
snj14 / SBMCommentsViewer.user.js
Created August 4, 2008 11:43
SBM Comments Viewer
// ==UserScript==
// @name SBM Comments Viewer
// @namespace http://white.s151.xrea.com/wiki/index.php?script/SBMCommentsViewer
// @description Show social bookmark's comments at the bottom of your browser.
// @include *
// ==/UserScript==
// by snj14
// Cc-by http://creativecommons.org/licenses/by/2.1/jp/
@snj14
snj14 / dollarX.js
Created August 3, 2008 12:03 — forked from cho45/dollarX.js
complex $X
// $X
//
// usage:
//
// $X(aExpression);
// $X(aExpression, aContext, aType);
// $X(aExpression, aContext, aType, aResolver, aNamespaceHash);
// $X(aNamespaceHash, aResolver, aType, aContext, aExpression);
//
// or