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
import { spawn } from 'child_process' | |
import { createServer, request } from 'http' | |
import pidtree from 'pidtree' | |
const deployCommand = ['npm', ['start']] | |
const deployWait = 30 * 1000 | |
const deploySecretPath = '/~deploy-01HPZ2ACGJSJJ0NGX9MT1RYRDB' | |
let server = startServer(8001) |
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
struct CompilerCache: soul::patch::RefCountHelper<soul::patch::CompilerCache, CompilerCache> { | |
std::mutex mutex; | |
std::filesystem::path path; | |
CompilerCache(std::filesystem::path path): path(path) { | |
std::filesystem::create_directory(path); | |
} | |
void storeItemInCache(const char* key, const void* source, uint64_t sourceSize) override { | |
std::scoped_lock lock(mutex); | |
std::ofstream file(this->path / key, std::ifstream::out | std::ifstream::binary); | |
file.write((char*) source, sourceSize); |
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
setInterval(() => { | |
if (document.body.innerText.includes('Load new messages.')) | |
window.location.reload(); | |
}, 90000) |
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
a:hover::after { | |
content: attr(href); | |
position: fixed; | |
left: 4px; | |
bottom: 4px; | |
padding: 4px; | |
font-size: 12px; | |
font-family: -apple-system, BlinkMacSystemFont; | |
font-weight: normal; | |
color: black; |
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
document.addEventListener("dragover", e => e.preventDefault()) |
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 listener = e => e.stopPropagation(); | |
const query = () => document.querySelectorAll('a[target=_blank]').forEach(a => { | |
a.removeEventListener('click', listener); | |
a.addEventListener('click', listener, true); | |
}); | |
query(); | |
setInterval(query, 400); // wait time between DOM queries, in milliseconds | |
})(); |
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 highlightResults = (text, color) => { | |
document.designMode = "on"; // https://stackoverflow.com/a/5887719 | |
var selection = window.getSelection(); | |
selection.collapse(document.body, 0); | |
while (window.find(text)) { | |
document.execCommand("HiliteColor", false, color); | |
selection.collapseToEnd(); | |
} | |
document.designMode = "off"; |
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
{ | |
"tabs": [ | |
{ | |
"title": "Substack Reader", | |
"url": "https://reader.substack.com", | |
"customJs": ["https://gist.githubusercontent.com/kofigumbs/4a9708a35807dd16f2541dc3204d6a25/raw/1579800b262aee48a3c731e0f00e3ce2d20cca01/link.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
document.addEventListener("keydown", event => { | |
if (event.metaKey && event.key === "k") { | |
event.preventDefault(); | |
const input = document.createElement("input"); | |
input.required = true; | |
input.type = "url"; | |
input.placeholder = "URL"; | |
input.style.position = "absolute"; | |
input.style.top = "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
#version 150 | |
uniform float time; | |
uniform vec2 resolution; | |
uniform sampler2D bitmoji; | |
in VertexData | |
{ | |
vec4 v_position; | |
vec3 v_normal; |
NewerOlder