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
| //GitHub raw to RawGit. enjoy. | |
| //Example: | |
| //https://github.com/lokesh/color-thief/raw/master/dist/color-thief.min.js | |
| //becomes | |
| //https://rawgit.com/lokesh/color-thief/master/dist/color-thief.min.js | |
| var rawgitURL = 'http://rawgit.com'; | |
| //If this Button exists (raw button) | |
| if (typeof document.getElementById("raw-url") != "undefined"){ |
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 base = [(1!=location.href.split(location.href.split("/").pop())[0].length?location.href.split(location.href.split("/").pop())[0]:(location.protocol,location.protocol+"//"+location.host+"/")).replace(location.protocol+"//"+location.protocol+"//"+location.protocol+"://")] | |
| console.log(base.toString()) |
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 decodeEntities = (function() { | |
| // this prevents any overhead from creating the object each time | |
| var element = document.createElement('div'); | |
| // regular expression matching HTML entities | |
| var entity = /&(?:#x[a-f0-9]+|#[0-9]+|[a-z0-9]+);?/ig; | |
| return function decodeHTMLEntities(str) { | |
| // find and replace all the html entities | |
| str = str.replace(entity, function(m) { |
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
| //Rextester.Program.Main is the entry point for your code. Don't change it. | |
| //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text.RegularExpressions; | |
| using System.Reflection; | |
| namespace Rextester |
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 getImageLightness(imageSrc,callback) { | |
| var img = document.createElement("img"); | |
| img.src = imageSrc; | |
| img.style.display = "none"; | |
| document.body.appendChild(img); | |
| var colorSum = 0; | |
| img.onload = function() { | |
| // create canvas |
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
| /* | |
| * object.watch polyfill | |
| * | |
| * 2012-04-03 | |
| * | |
| * By Eli Grey, http://eligrey.com | |
| * Public Domain. | |
| * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
| */ |
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
| urls: | |
| http://mubert.com/ | |
| http://demo.mubert.com/ | |
| http://play.mubert.com/ | |
| http://play.mubert.com/pro/ | |
| http://play.mubert.com/en/ | |
| IDK (Chillstep?) | |
| http://mubert.com:49994/ |
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
| //general placement stuffs | |
| .input-group.with-icon { | |
| //padding for icon | |
| input { | |
| padding-right: 2rem; | |
| &::-ms-clear { | |
| //hide nasty ie clear thingie | |
| display: none; | |
| } //general placement stuffs | |
| } |
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
| //HTML-Tag mit jQuery ändern | |
| $.extend({ | |
| replaceTag: function (element, tagName, withDataAndEvents, deepWithDataAndEvents) { | |
| var newTag = $("<" + tagName + ">")[0]; | |
| $.each(element.attributes, function () { | |
| newTag.setAttribute(this.name, this.value); | |
| }); | |
| $(element).contents().clone(withDataAndEvents, deepWithDataAndEvents).appendTo(newTag); | |
| return newTag; |
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
| //public files | |
| app.get('/*', function (req, res) { | |
| if(typeof req.params[0] !== 'undefined') | |
| res.sendFile(`public/${req.params[0]}`, { root: '.' }); | |
| }) | |
| or simply | |
| app.use(express.static('public')); |
OlderNewer