#!/usr/bin/env bash | |
lscmd=(ls -lh) | |
if command -v &>/dev/null tree; then | |
lscmd=( | |
tree | |
-I gists | |
-I vim | |
-I vendor | |
-I node_modules | |
-I venv |
--[[ | |
lvim is the global options object | |
After changing plugin config exit and reopen LunarVim, then run | |
:PackerInstall and :PackerCompile. Sometimes it's also necessary to delete | |
~/.config/lvim/plugin/packer_compiled.lua and run :PackerSync. | |
]] | |
-- general |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
set -gx PATH ~/bin ~/go/bin $PATH | |
function fish_user_key_bindings | |
bind \cz 'fg 2>/dev/null; commandline -f repaint' | |
end | |
set -g EP_PATH \ | |
$HOME/src 3 \ | |
$HOME/p 4 |
Only occurs when multiplying a string with an interpolation containing a suffix (i.e., the "\n"). Doesn't matter what the suffix is, does not seem to result in any difference for how many bytes are taken from the start of the third duplication.
The third entry onward in a string multiplication is missing 16 bytes, which have been replaced with NULs.
If the interpolation is instead a prefix, nothing incorrect happens.
Using concatenation instead of interpolation also works correctly.
In the second case, if using . in the interpolation instead of tojson, corruption of the string content occurs. If multiplied by 6 or more, the corruption seems to be stable, but doesn't appear to have any rhyme or reason to the content of the 16 bytes.
#!/usr/bin/env bash | |
# cleanroom: run a command or shell in a clean, temporary copy of a repository. | |
case "$1" in | |
-h|-help|--help) | |
cat <<'USAGE' | |
Usage: cleanroom [-h|-help|--help] [CMD...] | |
Execute a command in a clone of the current repository, made under | |
a temporary directory. |
v1 is the original v1.5.3 tag, v2 is the changed v1.5.3 tag. | |
diff -U2 -r v1/consul-1.5.3/vendor/k8s.io/client-go/pkg/version/base.go v2/consul-1.5.3/vendor/k8s.io/client-go/pkg/version/base.go | |
--- v1/consul-1.5.3/vendor/k8s.io/client-go/pkg/version/base.go 2019-07-25 16:41:17.000000000 -0700 | |
+++ v2/consul-1.5.3/vendor/k8s.io/client-go/pkg/version/base.go 2019-07-25 16:41:17.000000000 -0700 | |
@@ -56,5 +56,5 @@ | |
// companion .gitattributes file containing 'export-subst' in this same | |
// directory. See also https://git-scm.com/docs/gitattributes | |
- gitVersion string = "v0.0.0-master+a42ded477c" | |
+ gitVersion string = "v0.0.0-master+a42ded477" |
#!/usr/bin/env bash | |
# Copyright Noel Cower 2019. | |
# Distributed under the Boost Software License, Version 1.0. | |
# (See accompanying file LICENSE_1_0.txt or copy at | |
# https://www.boost.org/LICENSE_1_0.txt) | |
# Usage: nomad-tweak <job> [options...] <jq-script> | |
# | |
# Options: | |
# -A, --apply |
#!/bin/bash | |
# Usage: eval "$(withtemp [varname [mktempargs]]) | |
# | |
# If varname is given, a tempfile is generated, its path assigned to the | |
# variable $varname, and deleted upon exit. Otherwise, no varname | |
# becomes 'tempfile' and no arguments are passed to mktemp. Varname is | |
# not exported or local, but you may evaluate using either | |
# | |
# $ eval "local $(withtemp ...)" | |
# |