Skip to content

Instantly share code, notes, and snippets.

View blubbll's full-sized avatar
🔷

B͈̤̖̪̪̱ͅl̯̯̮̼͎̬͚̳̩̖̲u̜̼͉͈̠b͙̬̘̙̱̗̲͙b͍̞̬̬͓̼l̰̪͖̯̼̟̟͈̖͕̜̱̜ͅl̻̗͔̝̭̰͚͇̯̥ blubbll

🔷
View GitHub Profile
@blubbll
blubbll / rawgitit.js
Last active November 10, 2018 22:20
GitHub Userscript for rawgit instead of rawgit. (https://rawgit.com/)
//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"){
@blubbll
blubbll / getBase.js
Last active May 24, 2018 12:07
JS get Base url
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())
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) {
@blubbll
blubbll / getMethods.cs
Last active August 2, 2018 16:26
c# get methods
//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
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
@blubbll
blubbll / obj_watch.js
Last active August 17, 2018 23:52
Object watch polyfill
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@blubbll
blubbll / gist:5386de9531b61385c64c1b17607f1ffd
Last active December 8, 2022 04:53
Mubert (outdated)
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/
@blubbll
blubbll / :).scss
Created August 27, 2018 13:05
BS4 Simple Input with Icon :)
//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
}
//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;
//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'));