Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| /*! | |
| * Dynamically changing favicons with JavaScript | |
| * Works in all A-grade browsers except Safari and Internet Explorer | |
| * Demo: http://mathiasbynens.be/demo/dynamic-favicons | |
| */ | |
| // HTML5™, baby! http://mathiasbynens.be/notes/document-head | |
| document.head || (document.head = document.getElementsByTagName('head')[0]); | |
| function changeFavicon(src) { |
| /* generateClasses generates classes string from a passed object, i.e. | |
| generateClasses({ | |
| 'class1': true, | |
| 'class2': false, | |
| 'class3': true | |
| }); | |
| // will return string 'class1 class3' | |
| */ | |
| (function() { |
| /* | |
| * object.watch polyfill | |
| * | |
| * 2012-04-03 | |
| * | |
| * By Eli Grey, http://eligrey.com | |
| * Public Domain. | |
| * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
| */ |
| const stringToColor = (str) => { | |
| let hash = 0; | |
| let color = '#'; | |
| let defaultColor = '#333333'; | |
| let i; | |
| let value; | |
| let strLength; | |
| if(!str) { | |
| return defaultColor; |
| // 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: |
| <!-- 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> |
| { | |
| "// my options for SublimeLinter " : "//", | |
| "jshint_options" : { | |
| "boss": true, | |
| "browser": true, | |
| "curly": false, | |
| "devel": true, | |
| "eqeqeq": false, | |
| "eqnull": true, |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| 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(); | |
| } |
| 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; |