Skip to content

Instantly share code, notes, and snippets.

@c7x43t
c7x43t / ReZept.txt
Last active October 14, 2021 18:34
Maca 500mg | 3g
Horny Goat Weed 500mg
Fenugreek | Bockshornklee 500mg | 350mg
Korean Ginseng 100mg
Ginkgo Bilboa 120mg
Tribulus Terrestris 750mg
Ashwaganda 300mg
Grünteeextrakt 250mg
(Rhodiola Rosea) 250mg
(Chinese astragalus root)
var reg=/(?:^|\s?)([\w\u00C0-\u017Fa-zA-Z-']+)(?:$|\s?)/g;
// __
function tokenize(text){
var tokens = Array.from(text.matchAll(/(?:^|\s?)([\w\u00C0-\u017Fa-zA-Z-']+)(?:$|\s?)/g)).map(e=>e[1]);
return tokens;
}
@c7x43t
c7x43t / reset.css
Last active September 1, 2021 14:15
// https://github.com/necolas/normalize.css/blob/master/normalize.css
// https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css
// https://meyerweb.com/eric/tools/css/reset/
// https://gist.github.com/marharyta/b83a3683085eb42867bbcefb34687af8 // Reboot css
// https://elad.medium.com/normalize-css-or-css-reset-9d75175c5d1e // typography
*,::before,::after{box-sizing:border-box}
html{line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent;-moz-tab-size:4;tab-size:4;font-size:16px}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Fira Sans','Droid Sans','Helvetica Neue',sans-serif;font-weight:400;font-size:1rem;text-align:left;background-color:#fff}
[tabindex="-1"]:focus{outline:none!important}
h1{font-size:2rem}
// Execute a function as soon as the website has loaded
// compatibility: ES3
function loadScript(script) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len;_key++) {
args[_key - 1] = arguments[_key];
}
if (document.readyState === "complete" || document.readyState === "interactive") {
script.apply(void 0, args);
} else {
document.addEventListener("DOMContentLoaded",script.bind.apply(script, [this].concat(args)));
// throttle a function with requestanimationFrame
// throttledFunction = throttleAnimationFrame(func, immediate=false)
// which problem is solved? If you have a frequent event source you need to react
// to with a possible rerender of view components, then the function need to be executed
// with the next render frame but no more than once per render frame to save cpu cycles
// example:
// document.addEventListener('scroll',throttleAnimationFrame(eventHandler)) // will trigger at most once every render frame
var throttleAnimationFrame = (function(){
var stack=new Map();
var called=new Map();
function isObject(o){return typeof o === "object" && o !==null}
function generatePatch(classNames){
var result='';
for(var className of classNames){
// CookieStore
var classPatch='';
if(className in window){
classPatch+=`function ${className}(){}\n`;
var classPrototype=window[className].prototype;
var descriptors=Object.getOwnPropertyDescriptors(classPrototype);
https://stackoverflow.com/questions/48011613/rendering-webgl-image-in-headless-chrome-without-a-gpu
(function(){
var __getContext=HTMLCanvasElement.prototype.getContext;
Object.defineProperty(HTMLCanvasElement.prototype,'getContext',{
configurable: true,
enumerable: true,
value: function getContext(contextType, contextAttributes={}){
var options={
premultipliedAlpha: false
}
fastboot boot twrp-3.5.2_9-0-jasmine_sprout.img
adb reboot bootloader
fastboot flashing unlock
# adb boot into fastboot:
adb reboot bootloader
fastboot flash recovery twrp.img
# if error: FAILED (remote: '(recovery_b) No such partition')
// https://arh.antoinevastel.com/reports/stats/menu.html
// https://news.ycombinator.com/item?id=20479015
// https://github.com/JonasCz/How-To-Prevent-Scraping
// https://dzone.com/articles/5-puppeteer-tricks-that-will-make-your-web-scrapin
// https://github.com/infosimples/detect-headless
// https://antoinevastel.com/bot%20detection/2018/01/17/detect-chrome-headless-v2.html
// https://webscraping.pro/headless-chrome-detection-and-anti-detection/
// https://stackoverflow.com/questions/55364643/headless-browser-detection
// https://github.com/infosimples/detect-headless
// https://bot.incolumitas.com/
function loadElementsSecure(query,root,timeout){
if(timeout===undefined){
timeout=10000;
}
if(root===undefined){
root=document;
}
var t0=Date.now();
return new Promise(function(resolve,reject){
function _loadElements(){