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
;; this is src/myproject/boot_build.clj | |
(ns myproject.boot-build | |
(:require [boot.core :as core] | |
[cemerick.pomegranate.aether :as aether] | |
[boot.util :as util] | |
[boot.pod :as pod] | |
[clojure.java.io :as io] | |
[clojure.string :as str] | |
[cheshire.core :as json] |
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
#!/usr/bin/env bash | |
# Parse Nagios plugins ranges in Bash. Only integers. | |
# https://nagios-plugins.org/doc/guidelines.html#THRESHOLDFORMAT | |
set -euo pipefail | |
inrange () { | |
local r v | |
local v1 v2 |
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
convert xxx.mp4 -coalesce -layers OptimizeFrame xxx.gif |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
ME='' | |
GITHUB_API_TOKEN=${GITHUB_API_TOKEN:-} | |
ACTION=false | |
CURL=${CURL:-curl} | |
JQ=${JQ:-jq} |
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
{ config, lib, pkgs, ... }: | |
let | |
inherit (builtins) attrNames; | |
inherit (lib) mkIf concatMapStringsSep; | |
inherit (config.deployment) keys; | |
store = "/root/keys"; | |
runkeys = "/run/keys"; |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
ME='' | |
GITHUB_API_TOKEN=${GITHUB_API_TOKEN:-} | |
ACTION=false | |
CURL=${CURL:-curl} | |
JQ=${JQ:-jq} |
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
strBase64: | |
let | |
inherit (builtins) | |
concatStringsSep genList stringLength substring trace ; | |
base64 = { | |
# n=0; for l in {A..Z} {a..z} {0..9} + /; do printf '"%s" = %2s; ' $l $n; (( n++ )); (( n % 8 )) || echo; done | |
"A" = 0; "B" = 1; "C" = 2; "D" = 3; "E" = 4; "F" = 5; "G" = 6; "H" = 7; |
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 Text.XML.HXT.Core | |
main = runX $ | |
readDocument [ withValidate no ] "in.xml" >>> addRuntimeScope >>> | |
writeDocument [ withIndent yes ] "out.xml" | |
addRuntimeScope = processTopDown (runtimeScope `when` noScope) | |
runtimeScope = replaceChildren (getChildren <+> scope) where | |
scope = mkelem "scope" [] [ txt "runtime" ] |