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
/** | |
* Proof of concept ESLint rule for warning about potential | |
* XSS vulnerabilities caused by mixing innerHTML/text node | |
* property access. | |
* | |
* More here: http://benv.ca/2012/10/2/you-are-probably-misusing-DOM-text-methods/ | |
*/ | |
'use strict'; | |
var WARNING_MSG = |
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
$('img').attr('src', 'http://i2.kym-cdn.com/photos/images/facebook/000/001/582/picard-facepalm.jpg'); |
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" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<script type="text/javascript">window.jQuery || document.write('<script src="https://cdn3.vox-cdn.com/javascripts/vendor/jquery-1.11.2.min.js"><\/script>');</script> | |
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script> | |
<script type="text/javascript">window._ || document.write('<script src="https://cdn0.vox-cdn.com/javascripts/vendor/underscore-1.5.2.min.vd22f881.js"><\/script>');</script> | |
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script> | |
<script type="text/javascript">window.Backbone || document.write('<script src="https://cdn3.vox-cdn.com/javascripts/vendor/backbone-1.0.0.min.v3541019.js"><\/script>');</script> |
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
# | |
# 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 = [], |
OlderNewer