Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
(function () { | |
this.uniqid = function (pr, en) { | |
var pr = pr || '', en = en || false, result; | |
this.seed = function (s, w) { | |
s = parseInt(s, 10).toString(16); | |
return w < s.length ? s.slice(s.length - w) : (w > s.length) ? new Array(1 + (w - s.length)).join('0') + s : s; | |
}; | |
result = pr + this.seed(parseInt(new Date().getTime() / 1000, 10), 8) + this.seed(Math.floor(Math.random() * 0x75bcd15) + 1, 5); |
(function () { | |
this.browserTransform = function () { | |
if ('OTransform' in document.body.style) | |
return '-o-transform'; | |
else if ('webkitTransform' in document.body.style) | |
return '-webkit-transform'; | |
else if ('mozTransform' in document.body.style) |
Object.prototype.findEntity = function(keyObj) { | |
var arr = this, p, key, val, ret; | |
for (p in keyObj) { | |
if (keyObj.hasOwnProperty(p)) { | |
key = p; | |
val = keyObj[p]; | |
} | |
} | |
for (p in arr) { | |
if (p == key) { |
String.prototype.hashCode = function() { | |
var hash = 0; | |
try { | |
if (this.length == 0) return hash; | |
for (i = 0; i < this.length; i++) { | |
char = this.charCodeAt(i); | |
hash = ((hash << 5) - hash) + char; |
var YAR = function(nseed) { | |
var seed, constant = Math.pow(2, 13) + 1, | |
prime = 37, | |
maximum = Math.pow(2, 50); | |
if (nseed) { | |
seed = nseed; | |
} | |
if (seed == null) { | |
seed = (new Date()).getTime(); | |
} |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
{ | |
"// my options for SublimeLinter " : "//", | |
"jshint_options" : { | |
"boss": true, | |
"browser": true, | |
"curly": false, | |
"devel": true, | |
"eqeqeq": false, | |
"eqnull": true, |
<!-- HTML code --> | |
<video id="player" x-webkit-airplay="allow" class="player"> | |
<source src="http://techslides.com/demos/sample-videos/small.webm" type="video/webm"> | |
<source src="http://techslides.com/demos/sample-videos/small.ogv" type="video/ogg"> | |
<source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4"> | |
<source src="http://techslides.com/demos/sample-videos/small.3gp" type="video/3gp"> | |
</video> | |
<div id="play-controls"> | |
<button type="button" id="mute"><i class="fa fa-volume-up fa-lg"></i></button> |
// Detect if AirPlay is available | |
// Mac OS Safari 9+ only | |
if (window.WebKitPlaybackTargetAvailabilityEvent) { | |
video.addEventListener('webkitplaybacktargetavailabilitychanged', function(event) { | |
switch (event.availability) { | |
case "available": | |
airPlay.style.display = 'block'; | |
break; | |
default: |
const stringToColor = (str) => { | |
let hash = 0; | |
let color = '#'; | |
let defaultColor = '#333333'; | |
let i; | |
let value; | |
let strLength; | |
if(!str) { | |
return defaultColor; |