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
#!/bin/sh | |
# Gist: https://gist.github.com/bitsmanent/204b24de2f0d36ac03f45783391a2786 | |
DELAY=180 | |
DEFAULT_PATH="$HOME/.wallpapers" | |
NEWLINE=" | |
" | |
ARGV0="$(basename "$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
(() => { | |
"use strict"; | |
/* Why don't overwrite setTimeout()? It's doable but... | |
* https://www.adequatelygood.com/Replacing-setTimeout-Globally.html | |
* Also we may want to keep running high priority timers one day. */ | |
const timers = []; | |
const state = { | |
paused: false, |
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 crypto = require("crypto"); | |
const config = { | |
hashBytes: 32, | |
saltBytes: 16, | |
iterations: 300000, | |
digest: "sha512" | |
}; | |
function hashPassword(pwd) { |
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
#!/bin/sh | |
# Gist: https://gist.github.com/bitsmanent/6ce604a5f09bd77b59fbbdf9dab818d1 | |
# https://www.pexels.com/it-it/api/documentation | |
# include resource file | |
. ~/.pexelsrc | |
# kill another instance if running | |
mypid=$$ |
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
/* quick-and-dirty */ | |
const Types = { | |
string: x => typeof x == "string", | |
number: x => typeof x == "number" | |
}; | |
const Interface = model => { | |
const check = scope => { | |
let fails = 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
/* core chaining and context builder */ | |
(() => { | |
"use strict"; | |
const plugins = {}; | |
const ready = { | |
callbacks: [], | |
installed: false | |
}; | |
let oref = null; |
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
int | |
msleep(int ms) { | |
struct timespec req = {0}, rem; | |
int r = ms / 1000; | |
if(r >= 1) { | |
req.tv_sec = r; | |
ms -= r * 1000; | |
} | |
if(ms) |
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
int | |
xstrftime(char *s, size_t max, const char *format, const struct tm *tm) { | |
char *fmt; | |
int slen, flen; | |
flen = strlen(format); | |
if(!(fmt = malloc(flen + 1))) | |
return -1; | |
fmt[0] = 'x'; | |
memcpy(&fmt[1], format, flen); |
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
# opensmtpd smtpd.conf | |
# | |
# Current version: | |
# https://github.com/OpenSMTPD/OpenSMTPD/issues/1171#issuecomment-1139450955 | |
# | |
# Installed additional packages: | |
# debhelper libdb-dev libpam0g-dev libevent-dev bison | |
# | |
# Also note: /etc/smtpd created by hand. |
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 domapply(target, nodes) { | |
const children = target.childNodes; | |
var child, n, has; | |
nodes.forEach((node,i) => { | |
/* skip comment node */ | |
if(node.nodeType == Node.COMMENT_NODE) | |
return; | |
child = children[i]; | |
/* add missing nodes */ |
NewerOlder