This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React App</title> | |
</head> | |
<body> | |
<script type="importmap"> | |
{ | |
"imports": { |
This file contains 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
if (HTMLScriptElement.supports && HTMLScriptElement.supports('importmap')) { | |
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap | |
const importMap = { | |
imports: { | |
lazyload: 'IntersectionObserver' in window | |
? './lazyload.js' | |
: './lazyload-fallback.js', | |
}, | |
}; |
This file contains 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 createCSV(data, fileName) { | |
const headers = [ | |
'id', | |
'author_name', | |
'post', | |
'is_post', | |
'comment', | |
'is_comment', | |
'first_name', | |
'last_name', |
This file contains 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
// Adapted from https://raddle.me/f/Privacy/3722/how-to-circumvent-cloudflare-s-email-protected-thing-without with the help of chatGPT | |
function fixObfuscatedEmails() { | |
const elements = document.getElementsByClassName('__cf_email__'); | |
for (let i = 0; i < elements.length; i++) { | |
const element = elements[i]; | |
const obfuscatedEmail = element.getAttribute('data-cfemail'); | |
if (obfuscatedEmail) { | |
const decodedEmail = decrypt(obfuscatedEmail); | |
element.setAttribute('href', 'mailto:' + decodedEmail); | |
element.innerHTML = decodedEmail; |
This file contains 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
初志貫徹 (shoshikantetsu) - "to carry out original intent" | |
一期一会 (ichigoichie) - "Treasure every encounter, for it will never recur." | |
一日一歩 (iichinichiippo) - "One step each day." | |
十人十色 (jūnintoiro) - "To each their own; So many people, so many minds" | |
匠の技 (Takumi no waza) - "the expertise of master craftsmen" |
This file contains 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
const buf = new ArrayBuffer(maxBufferLen); | |
const dv = new DataView(buf); | |
class MagicWindow { | |
constructor(name, getter, setter) { | |
Object.defineProperty (window, name, { | |
get: getter, | |
set: setter | |
}); | |
} |
This file contains 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
[...Array(256).keys()].map((idx)=>{idx=Number(idx);return{char:String.fromCharCode(idx), hex: idx.toString(16), dec: idx, bin: (idx >>> 0).toString(2).padStart(8,'0')}}) |
This file contains 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
async (clipboardContentString) => { | |
try { | |
const response = await fetch("https://api.openai.com/v1/completions", { | |
method: "POST", | |
headers: { | |
"Content-Type": "application/json", | |
"Authorization": "Bearer YOUR API KEY HERE" | |
}, | |
body: JSON.stringify({ | |
model: "text-davinci-003", |
This file contains 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
// String stuff | |
const encodeStr = (str)=>new TextEncoder().encode(str) | |
const strLen = (str)=> encodeStr(str).length | |
const stoa = (str)=>Uint8Array.from(str, x => x.charCodeAt(0)) | |
const atos = (arr)=>String.fromCharCode.apply(null, arr) | |
// Base 2 stuff | |
const getBaseLog = (x, y) => (Math.log(y) / Math.log(x)) | |
const baseTwoLog = (y) => getBaseLog(2,y) | |
const powTwo = (x)=>Math.pow(2,x) |
This file contains 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
// extracts data from https://imgflip.com/popular-meme-ids | |
console.log("./imgflip-single.sh " + Array.from(document.querySelectorAll('table.admin-table tr td:nth-child(2n)')).map((a)=>a.innerText.replace(/[\W]+/g," ").split(' ').join('-')).join("\n./imgflip-single.sh ")) |
NewerOlder