Skip to content

Instantly share code, notes, and snippets.

View legumbre's full-sized avatar

Leonardo Etcheverry legumbre

  • GlamST / Ulta
  • Montevideo, Uruguay
View GitHub Profile
-- in src/common
-- python -m SimpleHTTPServer 10000 .
function dale()
require("socket.http")
host='localhost'
port='10000'
file='localuser.lua'
url='http://' .. host .. ':' .. port .. '/' .. file
str, h = socket.http.request(url)
(defmacro lif (COND THEN &rest ELSE)
"if con logging"
`(if ,COND
(progn
(message (format "(then) %s is true" (prin1-to-string (quote ,COND))))
,THEN)
(message (format "(else): %s is false" (prin1-to-string (quote ,COND))))
,@ELSE))
(lif (< 8 9)
(defmacro lif (COND THEN &rest ELSE)
`(if ,COND
(progn
(message (format "(then) %s is true" (prin1-to-string (quote ,COND))))
,THEN)
(message (format "(else): %s is false" (prin1-to-string (quote ,COND))))
,@ELSE))
(lif (< 8 9)
/*
mobile twitter mode
- adds rel="next" to the "Load older tweets" button
*/
require ("content-buffer.js");
define_page_mode("mobile_twitter_mode",
build_url_regexp($domain = "mobile.twitter",
$allow_www = true,
notany is a compiled Lisp function in `cl-extra.el'.
(notany PREDICATE SEQ...)
Return true if PREDICATE is false of every element of SEQ or SEQs.
[back]
register_user_stylesheet(
"data:text/css," +
escape (
"@-moz-document url-prefix(http://news.ycombinator.com/) {" +
".current {" +
" -moz-animation: 2s flash;" +
" background-color: #FCEDCC;" +
"}" +
"@-moz-keyframes flash { " +
" 0% { background-color: inherit; }" +
@legumbre
legumbre / gist:2767767
Created May 22, 2012 09:15
github compare url
https://github.com/legumbre/z80-stub/compare/341e5e1b89...c4fc82aa3a
https://github.com/legumbre/z80-stub/compare/341e5e1b89...c4fc82aa3a.patch
@legumbre
legumbre / .Xmodmap
Created May 5, 2012 09:55
conkeror meta key config under X11/MacOSX
! this did it, cmd is now working as Meta in Conkeror *and* Emacs
clear mod1
clear mod2
add mod4 = Meta_L
(setq emacs-lisp-mode-hook nil) ;; remove this once you're sure it works
(add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode)
(defun faster-cursor-movement ()
(progn
(define-key paredit-mode-map (kbd "C-M-p") (lambda () (interactive) (previous-line 5)))
(define-key paredit-mode-map (kbd "C-M-n") (lambda () (interactive) (next-line 5)))))
(eval-after-load 'paredit '(faster-cursor-movement))
@legumbre
legumbre / gist:2579804
Created May 2, 2012 19:57
no -printf in BSD find(1)
# find and lack of -printf in BSD, use stat -f as a workaround
find . -name '*.mp3' -print0 | xargs -0 stat -f "%m%t%Sm %N" | grep Apr | cut -d" " -f 5 | xargs -I{} cp {} /tmp/