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
// inspired from _.matches | |
function deepMatch (attrs) { | |
return function (obj) { | |
var attrVal, objVal; | |
if (obj === attrs) return true; //avoid comparing an object to itself. | |
for (var key in attrs) { | |
attrVal = attrs[key]; | |
objVal = obj[key]; | |
if (_.isObject(attrVal) && _.isObject(objVal)) { | |
if (!deepMatch(attrVal)(objVal)) { |
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
/* | |
Usage: | |
<span class="counter">10</span> | |
$(".counter").countTo({ | |
step: 5, // step, integer | |
start: 10, | |
stop: 20 | |
length: 500 // total duration in ms | |
}); |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
</head> | |
<body> | |
<script type="text/javascript" src="http://underscorejs.org/underscore.js"></script> | |
<script> | |
window.ip_blocks = ['feel me']; | |
// cidr2regex 0.0.3 | |
// 2009 xenowire |
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
[ | |
// Amazon | |
"23.20.0.0/14", | |
"27.0.0.0/22", | |
"43.250.192.0/24", | |
"43.250.193.0/24", | |
"46.51.128.0/18", | |
"46.51.192.0/20", | |
"46.51.216.0/21", | |
"46.51.224.0/19", |
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
# | |
# Example of a user's .screenrc file | |
# | |
# no annoying audible bell, please | |
#vbell on | |
vbell off | |
# detach on hangup | |
autodetach on |
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
var Form = Backbone.Form, | |
editors = Form.editors; | |
// we don't want our nested form to have a (nested) <form> tag | |
// (currently bbf includes form tags: https://github.com/powmedia/backbone-forms/issues/8) | |
// aside from being strange html to have nested form tags, it causes submission-upon-enter | |
Form.setTemplates({ | |
nestedForm: '<div class="bbf-nested-form">{{fieldsets}}</div>' | |
}); |
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(){ | |
var validators = Backbone.Form.validators; | |
//a validator verifying if an element is not in a given list | |
validators.errMessages.notInList = 'Must not be in list {{list}}'; | |
validators.notInList = function(options) { | |
if (!options.list) throw new Error('Missing required "list" options for "notInList" validator'); | |
options = _.extend({ | |
type: 'notInList', |
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
/* | |
Currently, the Object ItemType is not supported. | |
*/ | |
var Form = Backbone.Form, | |
editors = Form.editors; | |
Form.setTemplates({ | |
listKeyValueItem: '\ | |
<li>\ |
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
.bbf-field .bbf-keyvalue-editor input { | |
width: 45%; | |
} |
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
BEGIN; | |
LOCK events; | |
UPDATE events SET type = 'job:apply:tentative' WHERE type = 'job:apply:success' and date >= '2015-09-01'; | |
END; |
OlderNewer