Instead of checks like:
if (value === null) {
throw new Error("missing value")
}
doSomethingThatNeedsValue(value)
[Unit] | |
Description = Foo HTTP server | |
Requires = foo.socket | |
After = multi-user.target | |
[Service] | |
User = www-data | |
Group = www-data | |
WorkingDirectory = /var/foo | |
ExecStart = /var/foo/bin/foo-server |
tell application "System Events" | |
tell process "Firefox Nightly" | |
set tmp to value of attribute "AXEnhancedUserInterface" | |
set value of attribute "AXEnhancedUserInterface" to true | |
set returnUrl to value of attribute "AXValue" of text field 1 of combo box 1 of toolbar "Navigation" of UI element 1 of front window | |
set value of attribute "AXEnhancedUserInterface" to tmp | |
return returnUrl | |
end tell | |
end tell |
#!/usr/bin/env bash | |
# This is a script that provides infinite history to get around Alfred's 3-month limit. | |
# It works by regularly backing up and appending the items in the alfred db to a | |
# sqlite database in the user's home folder. It also provides search functionality. | |
# https://www.alfredforum.com/topic/10969-keep-clipboard-history-forever/?tab=comments#comment-68859 | |
# https://www.reddit.com/r/Alfred/comments/cde29x/script_to_manage_searching_backing_up_and/ | |
# Example Usage: | |
# alfred-clipboard.sh backup |
import { DisjointSet } from "@thi.ng/adjacency"; | |
import { cosineColor, GRADIENTS } from "@thi.ng/color"; | |
import { identity, partial } from "@thi.ng/compose"; | |
import { serialize } from "@thi.ng/hiccup"; | |
import { rect, svg, text } from "@thi.ng/hiccup-svg"; | |
import { fitClamped, wrap } from "@thi.ng/math"; | |
import { IRandom, Smush32 } from "@thi.ng/random"; | |
import { | |
buildKernel2d, | |
comp, |
#!/bin/bash | |
set -e | |
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc) | |
hex=$((cat <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
const SimplexNoise = require('simplex-noise'); | |
const simplex = new SimplexNoise(); | |
module.exports = curlNoise; | |
function curlNoise (x, y, z, out = new THREE.Vector3()) { | |
const eps = 1.0; | |
let n1, n2, a, b; | |
n1 = simplex.noise3D(x, y + eps, z); | |
n2 = simplex.noise3D(x, y - eps, z); |