This gist contains lists of modules available in
in AWS Lambda.
This gist contains lists of modules available in
in AWS Lambda.
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
gulp.task('less', function() { | |
return gulp.src('./style.less') // only compile the entry file | |
.pipe(less()) | |
.pipe(gulp.dest('./build')) | |
}); | |
gulp.task('watch', function() { | |
gulp.watch('./*.less', ['less']); // Watch all the .less files, then run the less task |
# http://stackoverflow.com/a/28818420/484780 | |
git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1` |
/** | |
* Returns the total amount of disk space used (in MB) by localStorage for the current domain. | |
*/ | |
var getLocalStorageSize = function() { | |
var total = 0; | |
for (var x in localStorage) { | |
// Value is multiplied by 2 due to data being stored in `utf-16` format, which requires twice the space. | |
var amount = (localStorage[x].length * 2) / 1024 / 1024; | |
total += amount; | |
} |
//MIT License | |
//Copyright (c) 2013, Max Irwin | |
//Parses a CIDR Range into beginning and ending IPv4 Addresses | |
//For example: '10.0.0.0/24' | |
//Returns ['10.0.0.0', '10.0.0.255'] | |
var parseCIDR = function(CIDR) { | |
//Beginning IP address | |
var beg = CIDR.substr(CIDR,CIDR.indexOf('/')); |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |