Skip to content

Instantly share code, notes, and snippets.

View how-to-fix-frankendebian.md
View chromium-os-docker.md
@christianbundy
christianbundy / required.js
Last active Mar 24, 2020
required arguments without explicit names
View required.js
const required = (argumentName = false) => {
try {
const fs = require("fs");
// Get the stack trace.
const copy = Error.prepareStackTrace;
Error.prepareStackTrace = (_, stack) => stack;
const stack = new Error().stack;
Error.prepareStackTrace = copy;
View ssb-scripts.md

opt into public web hosting

sbot publish --type about --about "@your.public.id.here" --publicWebHosting
@christianbundy
christianbundy / auto-google-foobar.js
Created Apr 29, 2015
Probably automatically gets you into Google Foobar. Probably.
View auto-google-foobar.js
// to be run on https://docs.python.org/3.5/reference/
// (probably works on other versions of the docs) (probably)
var topics = [];
var links = document.getElementsByTagName("a");
for (var i in links) {
if (links.hasOwnProperty(i)) {
var link = links[i];
var text = link.innerText;
if (typeof text === 'string') {
View equal-months.js
var years = 4;
var d = new Date();
d.setMonth(0);
d.setDate(1);
var last = d.setHours(0, 0, 0, 0);
var next = d.setYear(d.getFullYear() + 1);
var dozenth = (next - last) / 12;
View trippy.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
margin: 0;
background: #111;
min-width: 960px;
}
View for-loop.js
const config = {
init: 1,
condition: x => x <= 256,
each: x => console.info(`INFO: ${x}`),
afterEach: x => x * 2,
};
// DO NOT EDIT BELOW THIS LINE
(() => {
View lock.js
let lock;
const log = (msg) => {
lock = new Promise(async (resolve) => {
await lock;
console.log(msg);
setTimeout(resolve, 1000);
});
};