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
// Mixins for generating Block Element Modifier (BEM) class names. | |
// See https://css-tricks.com/snippets/sass/bem-mixins/ | |
// They can be nested to produce meaningful classes. | |
// To create a descendant selector like `.block--modifier .block__element` | |
// the block needs to be repeated. For example: | |
// +block(some-block) | |
// | |
// +element(some-element) | |
// color: red | |
// |
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 fs = require('fs'), | |
m = require('mongoose'); | |
fs.readdirSync(__dirname).forEach(function(filename) { | |
var schamaName = filename.replace(/\.js$/, ''), | |
Schema = require('./' + schemaName); | |
m.model(schemaName, Schema); | |
}); |
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> | |
<html> | |
<head> | |
<style> | |
body { | |
margin: 40px; | |
} | |
a { | |
display: inline-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
// ========================= getStyleProperty by kangax =============================== | |
// http://perfectionkills.com/feature-testing-css-properties/ | |
var getStyleProperty = (function(){ | |
var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms']; | |
var _cache = { }; | |
function getStyleProperty(propName, element) { |
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 oauthPercentEncode = (function(){ | |
var escapeChars = "!*'();:@&=+$,/?%#[]", | |
matchChars = new RegExp( "([\\" + ( escapeChars.split('').join('\\')) + "])", "gi"); | |
return function( p ) { | |
return p.replace( matchChars, function( char ) { | |
return '%' + ( "" + char ).charCodeAt(0).toString(16).toUpperCase(); | |
}) | |
} |
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
/** | |
* Replacement callback function | |
* | |
* @param array $match | |
* @return string | |
*/ | |
private function queryReplacementCallback($match) { | |
if (!isset($this->queryReplacementData[$match[2]]) || $this->queryReplacementData[$match[2]] === null) { | |
$replace = 'null'; | |
} else { |
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
/* GPL */ | |
/*Whitelist version with quick test*/ | |
function k(q){ | |
var s, | |
d = document.createElement("div"), | |
n = q, | |
p = [ "webkit", "moz", "ms", "O", "" ], | |
o = n, | |
r, j=0, len, l; |
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 when = require('when'); | |
unhandledRejectionsWithSourceMaps(when.Promise); | |
function unhandledRejectionsWithSourceMaps(Promise) { | |
Promise.onPotentiallyUnhandledRejection = function(r) { | |
setTimeout(function() { | |
if(!r.handled) { | |
throw r.value; | |
} |
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
//******************************************* | |
// Level 1, basic API, minimum support | |
//******************************************* | |
/* | |
Modules IDs are strings that follow CommonJS | |
module names. | |
*/ | |
//To load code at the top level JS file, | |
//or inside a module to dynamically fetch |
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
// PubSub impl. with require.js & backbone.js | |
// events.js | |
define(['underscore', 'backbone'], function (_, Backbone) { | |
'use strict'; | |
var events = {}; | |
_.extend(events, Backbone.Events); | |
return events; | |
}); |
OlderNewer