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
git remote prune origin | |
git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin |
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
/** | |
* Watcher leaks for jQuery | |
* RubaXa <[email protected]> | |
* MIT Licensed. | |
* | |
* API: | |
* $.leaks.get(); | |
* $.leaks.watch(); | |
* $.leaks.unwatch(); | |
* $.leaks.remove(); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.js"></script> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> |
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 version = 'v2.0.24:'; | |
var offlineFundamentals = [ | |
'/', | |
'/offline/' | |
]; | |
//Add core website files to cache during serviceworker installation | |
var updateStaticCache = function() { | |
return caches.open(version + 'fundamentals').then(function(cache) { |
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(global) { | |
'use strict'; | |
var JSON_TYPE_NAME = 'type'; | |
function getQueryString(queryParams) { | |
var params = Object.keys(queryParams).map(function(paramName) { | |
return [paramName, encodeURIComponent(queryParams[paramName])].join('='); | |
}); | |
return '?' + params.join('&'); |
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
/* | |
The main feature is script.async = false. | |
The async IDL attribute controls whether the element will execute asynchronously or not. | |
So if you will set async to false, scripts will load without blocking user i/o, but scripts will execute synchronously. | |
Support: | |
FF 4+ | |
FF for Android All Versions | |
IE 10+ (starting with preview 2) | |
Chrome 12+ | |
Chrome For Android All versions |
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 dataUri2Blob (dataUri) { | |
var dataUriArr = dataUri.split(';base64,'), | |
imageType = dataUriArr[0].replace('data:', ''), | |
base64Str = dataUriArr[1], | |
BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MSBlobBuilder || window.MozBlobBuilder, | |
binaryString = window.atob(base64Str), | |
bytes, | |
arrayBuffer, | |
blob; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>FileReader test</title> | |
</head> | |
<body> | |
<form action=""> | |
<input type=file multiple accept="image/*"><br/> | |
<input type=submit value="Run test"> |
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
Array.prototype.mergeAsNumber = function (array) { | |
var sortFunction = function (a,b) {return a-b}, | |
commonArray = this.concat(array).sort(sortFunction), | |
element, | |
suchNumberAnotherIndex; | |
for (var i = 0, l = commonArray.length; i<l; i++) { | |
element = commonArray[i]; | |
suchNumberAnotherIndex = commonArray.indexOf(element, i+1); | |
while (suchNumberAnotherIndex > -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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Open 3 tabs</title> | |
<script src="http://codeorigin.jquery.com/jquery-1.10.2.min.js"></script> | |
</head> | |
<body> | |
<div id="hidden_div"></div> | |
<script> |
NewerOlder