This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun exec-shell-command-sync (command &rest args) | |
(let (ret | |
(process | |
(apply 'start-process-shell-command "exec" nil command args))) | |
(set-process-filter | |
process | |
'(lambda (process output) | |
(setq ret (cons output ret)) | |
)) | |
(while (not (equalp (process-status process) 'exit)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document url-prefix(https://www.google.co.jp/reader), | |
url-prefix(https://www.google.com/reader) { | |
#gb:not(:hover), | |
#gb:not(:hover) > * { | |
max-height: 5px !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UA = (function(ua) { | |
var browsers = { | |
// Capture: Major#, #2, #3, #4, alphaBeta, alphaBeta# | |
ie: /InternetExplorer/ | |
, fx: /firefox\/(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?(?:(a|b)(\d*))?/i | |
, cr: /Chrome/ | |
, sf: /Safari/ | |
, op: /Opera/ | |
}, key, ret, obj = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wordAtPoint(text, point) { | |
var wordRx = /[a-zA-Z_]+/, separatorRx = /(\s)/, | |
words, word, i, len, n; | |
words = text.split(separatorRx); | |
for (i = n = 0, len = words.length; i < len; i++) { | |
if (point < (n += words[i].length)) { | |
if (wordRx.test(words[i])) { | |
word = words[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
// eventSettings: e.g. { eventName1: 2, eventName2: 3 } | |
$.fn.waitEvents = function(eventSettings, fn) { | |
var key, ret = {}, evts = eventSettings, | |
origEvts = $.extend(true, {}, evts); | |
for(key in evts) { | |
if(evts.hasOwnProperty(key)) { | |
this.bind(key, function(ev) { | |
var ley; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.random = function(n) { | |
var elms = Array.prototype.slice.call(this), option = { | |
number: 1 | |
}, ret = []; | |
$.extend(option, { number: n}); | |
n = option.number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[&?]q=([^&#?]+)(?!.*[&?]q=[^&#?]+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recurClone(input) { | |
var output = void(0), i, len; | |
if(input instanceof Array) { | |
output = []; | |
for(i=0,len=input.length; i<len; i++) { | |
output.push(recurClone(input[i])); | |
} | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recursivePush(arr, val) { | |
var execPush = false; | |
arr.forEach(function(_v) { | |
if(_v instanceof Array) { | |
recursivePush(_v, val); | |
} else { | |
execPush = true; | |
} | |
}); | |
if(execPush || !arr.length) { arr.push(val); }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun coffee-run-file-saving () | |
"Run coffee script in current buffer in new window" | |
(interactive) | |
(if buffer-file-name | |
(progn | |
(save-buffer) | |
(set-buffer | |
(apply 'make-comint "CoffeeRun" | |
coffee-command nil (cons buffer-file-name '()))) |