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
$.password | |
:blur | |
if @value === "" | |
.hide() | |
// Eventually, indenting beneath something will set it as the context | |
.prev() | |
.show().val(@default_value) | |
.blur() | |
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
= spans(!columns) | |
@for !column from 1 through !columns by 2 // through = .., to = ..., by = incrementor | |
+span(!column,!columns) | |
= span(!column, !columns) | |
.span-#{!column} | |
:width= 45px * !column + 15px | |
@if !column != !columns | |
:margin-right 15px | |
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
"foo" \ | |
"#{10.times do}" \ | |
"bar" \ | |
"#{end}" |
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
# Haml blocks (and ERB blocks, for that matter) don't return their contents as a string. | |
# They append content directly to the template. | |
# Thus, you need to use #capture to get their content. | |
# I'm not sure why this worked with ERB; it's probably just an odd consequence of an implementation detail. | |
# Method | |
def submit(*args, &block) | |
@template.content_tag(:div, :class => "save_actions") do | |
super(*args) + @template.capture(&block) |
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
# Thanks to Bill Clementson for parts of this snippet | |
# http://bc.tech.coop/ | |
function start_or_join_screen { | |
if [ "$TERM" != dumb -a "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" ] | |
then | |
STARTED_SCREEN=1 ; export STARTED_SCREEN | |
sleep 1 | |
if screen -RR | |
then |
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 gist-make-query-string (params) | |
"Returns a query string constructed from PARAMS, which should be | |
a list with elements of the form (KEY . VALUE). KEY and VALUE | |
should both be strings." | |
(mapconcat | |
(lambda (param) | |
(concat (url-hexify-string (car param)) "=" | |
(url-hexify-string (cdr param)))) | |
params "&")) |
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
;;;###autoload | |
(defun gist-region (begin end &optional private) | |
"Post the current region as a new paste at gist.github.com | |
Copies the URL into the kill ring. | |
With a prefix argument, makes a private paste." | |
(interactive "r\nP") | |
(let* ((file (or (buffer-file-name) (buffer-name))) | |
(name (file-name-nondirectory file)) |
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
;;;###autoload | |
(defun gist-region (begin end &optional private) | |
"Post the current region as a new paste at gist.github.com | |
Copies the URL into the kill ring. | |
With a prefix argument, makes a private paste." | |
(interactive "r\nP") | |
(let* ((file (or (buffer-file-name) (buffer-name))) | |
(name (file-name-nondirectory file)) | |
(ext (or (cdr (assoc major-mode gist-supported-modes-alist)) |
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
( |
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
( |
OlderNewer