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 redirect = (function () { | |
var isFirefox = false; | |
var browser = window.navigator.userAgent; | |
var location = window.location; | |
var fixFirefoxHistory = function () { | |
var hash = window.location.hash; | |
var timestamp = Date.now(); | |
if (isFirefox) { |
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
getCleanTodayTimestamp = function () { | |
return new Date().setHours(0, 0, 0, 0); | |
} |
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
/** | |
* Get position of given element in array or given sub-string in string | |
* | |
* @raram {String|Array} source | |
* @param {String|Number|Boolean} term | |
* | |
* @return {Number} Position of term in source or -1 | |
*/ | |
var indexOf = (function () { | |
var NEGATIVE = -1; |
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 formatThousands = function (input, separator) { | |
var output = []; | |
input = String(input).split('').reverse(); | |
if (separator === void 0 || separator == null) { | |
separator = ','; | |
} | |
for (var i = 0, len = input.length, lastIndex = len - 1; i < len; i++) { |
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
// Example of creation new plugin based on this one. | |
(function ($) { | |
var pluginName = 'myBoilerplate'; | |
var parent = $.fn.boilerplate; | |
var defaults = {}; | |
var Constructor = function (element, options) { | |
this.element = element; | |
this._settings = $.extend({}, defaults, options); |
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
:: archivers | |
choco install 7zip.install | |
:: messaging/collaboration | |
choco install skype | |
choco install teamviewer | |
:: iso/usb | |
choco install cdburnerxp | |
choco install poweriso |
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
// Easy way to parse raw URL without regex. | |
var locator = document.createElement('a'); | |
locator.href = 'http://google.com/?search=true&other=isnt#anchor' | |
console.log(locator.protocol); | |
console.log(locator.host); | |
console.log(locator.search); | |
console.log(locator.hash); |
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 createObject = (function () { | |
function Object() {} | |
return function createObjectF(obj) { | |
Object.prototype = obj; | |
obj = new Object(); | |
Object.prototype = null; | |
return obj; | |
} | |
}()); |
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 gulp = require('gulp') | |
var concat = require('gulp-concat') | |
var sourcemaps = require('gulp-sourcemaps') | |
var uglify = require('gulp-uglify') | |
var ngAnnotate = require('gulp-ng-annotate') | |
gulp.task('js', function () { | |
gulp.src(['src/**/module.js', 'src/**/*.js']) | |
.pipe(sourcemaps.init()) | |
.pipe(concat('app.js')) |
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 __$$play = HTMLAudioElement.prototype.play; | |
HTMLAudioElement.prototype.play = function () { | |
this.playbackRate = 2; | |
return __$$play.apply(this, arguments); | |
}; |