This file contains hidden or 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 countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
This file contains hidden or 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 listFilesIn = function (name) { | |
var def = when.defer(); | |
fs.readdir(basePath+name, function (err, files) { | |
if (err) { | |
def.reject(err); | |
} | |
var onlyfiles = []; | |
function checkIsFile(file, callback) { | |
// console.log("will check file: " + file); |
This file contains hidden or 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 pjson = require('../package.json'); | |
var log4js = require('log4js'); | |
var sLogger = log4js.getLogger('server'); | |
var bots = [ | |
'+https://developers.google.com/+/web/snippet/', // Google+ | |
'facebookexternalhit', | |
'Googlebot' | |
]; |
This file contains hidden or 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
<div ng-controller="langsCtrl"> | |
<tr ng-repeat="lang in langsList"> | |
<td>{{$index}}</td> | |
<td> | |
<div class="ade-editable" ade-text='{"className":"inputInTable"}' | |
ng-model="lang.lang_code" on-change='update(lang)'>{{lang.lang_code}}</div> | |
</td> | |
<td> | |
<div class="ade-editable" ade-text='{"className":"inputInTable"}' | |
ng-model="lang.alt" on-change='update(lang)'>{{lang.alt}}</div> |
This file contains hidden or 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
Object.defineProperty(Array.prototype, 'last', { | |
enumerable: false, | |
configurable: true, | |
get: function() { | |
return this[this.length - 1]; | |
}, | |
set: undefined | |
}); | |
/** |
This file contains hidden or 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
// same as ng-include, but it does not create it's own scope, if element already has a scope | |
angular.module('ng-tools').directive('includeInScope', | |
['$http', '$templateCache', '$anchorScroll', '$compile', | |
function ($http, $templateCache, $anchorScroll, $compile) { | |
return { | |
restrict: 'ECA', | |
terminal: true, | |
compile: function (element, attr) { | |
var srcExp = attr.includeInScope || attr.src, | |
onloadExp = attr.onload || '', |
This file contains hidden or 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
/** | |
* @class Gridster | |
* @uses Draggable | |
* @uses Collision | |
* @param {HTMLElement} el The HTMLelement that contains all the widgets. | |
* @param {Object} [options] An Object with all options you want to | |
* overwrite: | |
* @param {HTMLElement|String} [options.widget_selector] Define who will | |
* be the draggable widgets. Can be a CSS Selector String or a | |
* collection of HTMLElements |
This file contains hidden or 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 forbidden = ['mongooseCollection', '_collection']; | |
module.exports = function (query) { | |
var copy = {}; | |
for (var prop in query) { | |
if (forbidden.indexOf(prop) === -1) { | |
copy[prop] = query[prop]; | |
} | |
} | |
return JSON.stringify(copy); | |
}; |
This file contains hidden or 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 mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var blogSchema = new Schema({ | |
title: String, | |
author: String, | |
body: String, | |
date: { type: Date, default: Date.now } | |
}); |
This file contains hidden or 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
<div class="row show-grid"> | |
<div class="col-md-12"> | |
Parent comment | |
<div class="row show-grid"> | |
<div class="col-md-1" style="visibility: hidden;"> | |
</div> | |
<div class="col-md-11"> | |
Child comment | |
</div> | |
</div> |
OlderNewer