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
module Merb::Helpers::Form | |
def date_field(*args) | |
if bound?(*args) | |
current_form_context.bound_date_field(*args) | |
else | |
current_form_context.unbound_date_field(*args) | |
end | |
end | |
def datetime_field(*args) |
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
# Pretty prompt | |
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " |
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
<script type="text/javascript"> | |
//<![CDATA[ | |
var get_disqus_num_replies = function() { | |
var links = document.getElementsByTagName('a'); | |
var query = '?'; | |
for(var i = 0; i < links.length; i++) { | |
if(links[i].href.indexOf('#disqus_thread') >= 0) { | |
query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&'; | |
} | |
} |
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
/** | |
* Utility lib for setting/unsetting JavaScript breakpoints | |
* | |
* Usage: | |
* breakpoint.set('globalMethodName'); | |
* breakpoint.unset('globalMethodName'); | |
* | |
* breakpoint.set('namespacedMethodName', namespaceObject); | |
* breakpoint.unset('namespacedMethodName', namespaceObject); | |
*/ |
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
# | |
# Configuration File for JavaScript Lint 0.2.6 | |
# Developed by Matthias Miller (http://www.JavaScriptLint.com) | |
# | |
# This configuration file can be used to lint a collection of scripts, or to enable | |
# or disable warnings for scripts that are linted via the command line. | |
# | |
#### NOTE TO TEXTMATE BUNDLE USERS: | |
#### Feel free to experiment with enabling/disabling individual warnings to |
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
// Relevant jQuery Template source: | |
// https://github.com/jquery/jquery-tmpl/blob/master/jquery.tmpl.js#L206 | |
// Example usage: {{pretty_datetime some.date.obj}} | |
$.extend(jQuery.tmpl.tag, { | |
"pretty_datetime": { | |
open: "if($notnull_1){_.push(pretty_datetime($1a));}" | |
} | |
}); |
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
//-------------------------------------------------- | |
// Get binary value of checkbox checked/not-checked | |
//-------------------------------------------------- | |
// Seen often: | |
$('selector').attr('checked') ? 1 : 0; | |
// Alternatively: | |
Number($('selector').is(':checked')); |
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
/** | |
* Replace $.ajax on your subdomain with a copy taken | |
* from your base domain. All jQuery AJAX actions go | |
* through $.ajax (i.e. $.get, $.post), so it's all good. | |
*/ | |
(function() { | |
var iframe, | |
onload, | |
queue = [], |
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 forEach(arr, fn) { | |
var impl = fn.toString(); | |
var m = impl.match(/function \((\w+),?\s*(\w+)?\) { (.*) }/); | |
var arg0 = m[1]; | |
var arg1 = m[2]; | |
var body = m[3]; | |
var program = []; | |
program.push('var ' + arg0 + ';'); | |
if (arg1) | |
program.push('var ' + arg1 + ';'); |
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
// no document ready check - put this at the end of <body> | |
;(function() { | |
var pre = Array.prototype.slice.call(document.getElementsByTagName('code')); | |
pre.forEach(function (p) { | |
p.setAttribute('contenteditable', 'true'); | |
}); | |
})(); |
OlderNewer