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 / masto-count.js
Created October 25, 2018 10:37
masto-count
/** Mastodon has an API endpoint for instance, which returns all activated users,
but no count of all users (unconfirmed as well), so i had to implement this myself*/
setTimeout(() => {
let reportedCount = 0;
let checkLatestId = () => {
fetch(`${host}/api/v1/instance`).then(res => {
res.json().then(data => {
reportedCount = data.stats.user_count;
smc.set("fakeTotal", reportedCount);
});
var simpleLS = {
set : function(obj, val){
localStorage.setItem(obj, $.fn.stringifyJSON(val));
},
get: function(obj){
return $.parseJSON($.fn.stringifyJSON(localStorage.getItem(obj))) || {};
}
};
@blubbll
blubbll / checkEs5.js
Last active November 1, 2018 21:46
Is the JavaScript Browser evrsion es5?
/**!checkes5 by Blubbll*/
var es5 =
void 0!==Object.create&&
void 0!==Object.freeze&&
void 0!==Array.isArray&&
void 0!==Array.prototype.some&&
void 0!==Array.prototype.forEach&&
void 0!==Date.prototype.toISOString&&
void 0!==Function.prototype.bind&&
void 0!==JSON.parse;
@blubbll
blubbll / checkCors.js
Created November 1, 2018 23:01
check if browser has good cors support
var cors = ('withCredentials' in new XMLHttpRequest()|| typeof XDomainRequest === 'undefined');
var cors="withCredentials"in new XMLHttpRequest?1:"undefined"!=typeof XDomainRequest?2:0;
@blubbll
blubbll / materialadmin.css
Last active November 11, 2018 22:55
Material admin custom css
/* customheaderbg, fixed header */
#header {
position: fixed;
right: 0;
left: 0;
background: #22313a;
border-bottom: 16px solid #1e2a31;
}
https://www.deezer.com/desktop/download?platform=win32&architecture=x86
@blubbll
blubbll / es4.js
Created December 31, 2018 11:18
is the javascript Browser version es4? (support new keyword)
try{function dummy(){}new dummy,window.es4=!0}catch(n){window.es4=!1}
@blubbll
blubbll / gist:3ef8f6a4fd8b5d37e196348d062a25df
Last active January 17, 2019 14:00
navigator.connection.effectiveType
// 250 = 3g
// 350 = 1g
// 50 = 4g
//150 = 3g
@blubbll
blubbll / userscript.js
Created January 20, 2019 16:02
bs.to file sanitizer
//String ReplaceAll
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.split(search).join(replacement);
};
document.title=location.href.replace("https://bs.to/serie/","").replace("/Streamango","").replaceAll("/","_")
//für videofiles