Skip to content

Instantly share code, notes, and snippets.

View martinbalfanz's full-sized avatar

Martin Balfanz martinbalfanz

View GitHub Profile
@martinbalfanz
martinbalfanz / gist:1352722
Created November 9, 2011 19:47
eval and execute current defun
;; e.g. bind to C-c C-e in emacs-lisp-mode
(defun mb-eval-and-execute ()
"Evaluate and execute current defun."
(interactive)
(funcall (eval-defun-2)))
@martinbalfanz
martinbalfanz / gist:1149007
Created August 16, 2011 12:56
Modernizr tests to trigger webkit and opera
/* tests for webkit and opera to fix styling bugs :@ */
Modernizr.addTest('opera', function () {
return /Opera/.test(({}).toString.call(window.opera));
});
Modernizr.addTest('webkit', function () {
return Modernizr.testProp('-webkit-box-shadow');
});
/* css to trigger webkit
@martinbalfanz
martinbalfanz / gist:1105189
Created July 25, 2011 20:54
slime config
(add-to-list 'load-path "~/.emacs.d/slime")
(add-to-list 'load-path "~/.emacs.d/slime/contrib")
(when (require 'slime "slime" t)
(slime-setup '(slime-fancy slime-asdf slime-references slime-indentation)))
(setq slime-enable-evaluate-in-emacs t
slime-net-coding-system 'utf-8-unix
;; lisp-indent-function 'cl-indent:function
)
@martinbalfanz
martinbalfanz / gist:1103162
Created July 24, 2011 22:00
guess-my-number
(defparameter *big* 100)
(defparameter *small* 1)
(defun guess-my-number ()
(ash (+ *small* *big*) -1))
(defun smaller ()
(setq *big* (1- (guess-my-number)))
(guess-my-number))
@martinbalfanz
martinbalfanz / buttons.less
Created May 5, 2011 11:01
image-based buttons without additional html elements, written in lesscss
/* usage: <a href="#" class="button orange">click me!</a> */
@sprite: url("buttons.png");
.button(@top, @height:24px) {
display:inline-block;
background:@sprite left (-1*@top) no-repeat;
line-height:@height;
padding:0 0 0 10px;
@martinbalfanz
martinbalfanz / gist:921844
Created April 15, 2011 15:05
lesscss 2 column layout without floats
#main {
display:table;
#sidebar, #content {
display:table-cell;
}
#sidebar {
width:150px;
}
@martinbalfanz
martinbalfanz / gist:921825
Created April 15, 2011 14:54
lesscss 2 column layout, fix-width sidebar, flexible content
#main {
overflow:hidden;
#sidebar {
width:150px;
float:left;
}
#content {
margin-left:200px;