Skip to content

Instantly share code, notes, and snippets.

View christianbundy's full-sized avatar

Christian Bundy christianbundy

  • 12:30 (UTC -07:00)
View GitHub Profile

just setting up my gthb

@christianbundy
christianbundy / required.js
Last active March 24, 2020 20:10
required arguments without explicit names
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;

opt into public web hosting

sbot publish --type about --about "@your.public.id.here" --publicWebHosting
@christianbundy
christianbundy / auto-google-foobar.js
Created April 29, 2015 04:14
Probably automatically gets you into Google Foobar. Probably.
// 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') {
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;
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
margin: 0;
background: #111;
min-width: 960px;
}
const config = {
init: 1,
condition: x => x <= 256,
each: x => console.info(`INFO: ${x}`),
afterEach: x => x * 2,
};
// DO NOT EDIT BELOW THIS LINE
(() => {
let lock;
const log = (msg) => {
lock = new Promise(async (resolve) => {
await lock;
console.log(msg);
setTimeout(resolve, 1000);
});
};