lucaslarson / dotfiles Goto Github PK
View Code? Open in Web Editor NEWThis is where the ♥️ is at.
License: Other
This is where the ♥️ is at.
License: Other
more specifically:
using
PS4_temporary=${PS4}
PS4=''
set -x; ! || done! >/dev/null 2>&1;set +x
PS4=${PS4_temporary}
unset PS4_temporary
dotfiles/setup/linux/alpine/init.sh
Lines 15 to 208 in 7ed596e
# add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
# https://github.com/mathiasbynens/dotfiles/commit/fecb8c6
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh
note to self; context for consideration:
Having seen that I comprise half of zdharma-continuum/zsh-diff-so-fancy’s stargazers, I felt prompted to replace the plugin with the applicable npm package as was done with git-open
(802072a92a
)
On the other hand, if I move a package from $DOTFILES/.gitmodules
(and $DOTFILES/custom/plugins
into $(npm config get prefix --global)/bin
, then Dependabot will no longer keep nudging me to update.
package.json
and package-lock.json
)The scripts below appear shell-agnostic, but if running them using Bash on a system whose ${SHELL}
is Zsh, they don’t work at all.
For example, instead of:
. "${HOME}/.${SHELL##*/}rc" && exec "${SHELL##*/}" --login
we should use:
. "${HOME}/.${0##*[-/]}rc" && exec "${0##*[-/]}" --login
dotfiles/.oh-my-zsh/custom/aliases.zsh
Lines 227 to 231 in 124227f
Git v2.40.0 removed the Perl version of git add --interactive
.
Moreover, git-add--interactive
’s installation by way of Alpine Linux’s git-perl
has been unnecessary since Git v2.25.0, released in January 2020.
The core of the brewfile
function1 is unreadable without comments; add them.
dotfiles/.github/workflows/changelog.yml
Line 17 in d5e65bb
actions/setup-ruby
is deprecated;1 ruby/setup-ruby
2 is the recommended replacement.
-c quotePath=false
where git command to target audience-human output instead of git status
where scripting is not possible or likelyWhere git config
allows for scope-wide preference for escaping “unusual[ly]”1 named paths,2 the same functionality is available on a per-invocation level,3 which allows for temporary syntactic sugar without blindingly blunted defaults (the default behavior is to escape and quote such content, which is the safest and most reasonable default, especially in situations where a machine or other third party might parse the output).
To that end, in the instances where this repository calls for a function-scope -c color.status=always
, it should call also for unescaped pathnames -c core.quotePath=false
.
An alias whose name begins with -
or +
is not entirely portable.
-
or +
unless the assignment includes an end-of-options delimiter:2 alias -='cd -'
fails but alias -- -='cd -'
3 works as expectedalias -- -='cd -'
, but alias -='cd -'
works as expectedhttps://github.com/LucasLarson/dotfiles/blob/85bdd324fc76c11fb39fd53739c2eaf48b56cf85/custom/aliases.zsh#L79-L86 ↩
According to a part of the Zsh FAQ that hasn’t changed since 1999 or earlier, “To begin a zsh alias with a -
(dash, hyphen) character, use alias --
: . . . alias -- -"=fg %-"
” ↩
Alpine Linux v3.16 appears to run Busybox 1.35.0 (thanks, repology) ↩
changing the default shell with sed -E -i
is:
and the current replacement does:
dash
like Ubuntu and Debian, but that is fine, because while /bin/dash
is run, it a symlink to /bin/dash
, located at /bin/sh
, which is called, and which this solution does replaceLine 355 in cc50d8e
A variation of the formula appears in CodeSnippets.md
:
Lines 533 to 540 in cc50d8e
The current solution to change /etc/passwd
’s entries containing /bin/sh
, /bin/bash
, or /bin/ash
, to wherever zsh
is installed, is broken without proprietary extensions1 – marked “❗️” – to POSIX sed
:2
# https://github.com/LucasLarson/dotfiles/blob/cc50d8e6da/setup/init.sh#L346
# ╭──────────────────── ❗️ extended regex
# │ ╭───────────────── ❗️ modify files in-place
# │ │ ╭────────────── expression incoming
# │ │ │ ╭─────────── search for
# │ │ │ │ ╭─┬─ ❗️ using `?`, more properly `\?`, to
# │ │ │ │ │ │ mean “0 or 1” is a GNU extension
command sed -E -i -e "s|/bin/b?a?sh$|$(command -v -- zsh)|" '/etc/passwd'
# │╰────────┬─╯│╰─┬────────────────╯│ ╰─┬───────╯
# ╭──────────────────────────╯ ╰─╮╰╮ │ ╭───────────────╯ │
# ╰─ search for what’s between here and │ │ │ │ ╭───────────────────╯
# the next `|` │ │ │ │ │
# any line ending (`$`) in any of`/bin/sh` ─╯ │ │ │ │
# `/bin/bash`, `/bin/bsh`, `/bin/ash` │ │ │ │
# replace with everything from this `|` ───╯ │ │ │
# to the last `|` │ │ │
# the Z shell binary’s location, which is ─────╯ │ │
# probably `/bin/zsh` or `/usr/bin/zsh` │ │
# replacement expression complete ───────╯ │
# file with content to replace ─────────╯
dotfiles/.oh-my-zsh/custom/aliases.zsh
Lines 72 to 74 in 100a132
git log --oneline --decorate --graph
¹
serve better than @gggritso’s
git log --graph --branches --remotes --tags --format=format:'%Cgreen%h %Creset• %<(75,trunc)%s (%cN, %cr) %Cred%d' --date-order"
²
[✖] https://stackoverrun.com/ja/q/12834672 → Status: 0 Error: ESOCKETTIMEDOUT
at ClientRequest. (/usr/local/lib/node_modules/markdown-link-check/node_modules/request/request.js:816:19)
“apk add composer'を試みているDockerfileが失敗していますか?”
stackoverrun.com › ... - Translate this page
作曲-1.5.2-R0:でマスク:(!恐ろしく時代遅れ). を@testingそれはDockerfile 固定テストリポジトリというの作者と思われるので、あなたが @testing を追加 ...
1 answer
dotfiles/setup/linux/alpine/init.sh
Line 92 in 83532da
add something like “this may take a while”
[✖] https://stackoverrun.com/ja/q/12834672 → Status: 0 Error: ESOCKETTIMEDOUT
at ClientRequest. (/usr/local/lib/node_modules/markdown-link-check/node_modules/request/request.js:816:19)
“apk add composer'を試みているDockerfileが失敗していますか?”
stackoverrun.com › ... - Translate this page
作曲-1.5.2-R0:でマスク:(!恐ろしく時代遅れ). を@testingそれはDockerfile 固定テストリポジトリというの作者と思われるので、あなたが @testing を追加 ...
1 answer
remove Zsh codex while there’s no obvious code-completion successor:
OpenAI has discontinued code-davinci
models:
On March 23rd, we will discontinue support for the Codex API. All customers will have to transition to a different model. Codex was initially introduced as a free limited beta in 2021, and has maintained that status to date. Given the advancements of our newest GPT-3.5 models for coding tasks, we will no longer be supporting Codex and encourage all customers to transition to GPT-3.5-Turbo.
On March 23rd, we will discontinue support for the Codex API. All customers will have to transition to a different model. Codex was initially introduced as a free limited beta in 2021, and has maintained that status to date. Given the advancements of our newest GPT-3.5 models for coding tasks, we will no longer be supporting Codex and encourage all customers to transition to GPT-3.5-Turbo.
Models affected
The following models will be discontinued:code-cushman:001 code-cushman:002 code-davinci:001 code-davinci:002
We understand this transition may be temporarily inconvenient, but we are confident it will allow us to increase our investment in our latest and most capable models.
Originally posted by @oyale in tom-doerr/zsh_codex#16 (comment)
@github ends 11 years of serving git.io
redirections on 2022-04-291 after providing 3 days warning. This repository appears to contain affected content: search: git.io
/etc/motd
, or message of the day, is generally not helpful
printf '' >/etc/motd
dotfiles/setup/linux/alpine/init.sh
Lines 135 to 136 in 83532da
On Debian, the instruction will choke. command git
should be git
here:
Line 81 in 45645bd
Verifying git add -p
’s installation1 should allow looking in both /usr/lib/git-core
as well as the current search in /usr/libexec/git-core
2
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
.github/workflows/jsonlint.yml
actions/checkout v4
peter-evans/create-pull-request v6
.github/workflows/shellcheck-markdown.yml
actions/checkout v4
.github/workflows/super-linter.yml
actions/checkout v4
github/super-linter v5.0.0
There is shell code in 2047a6b108
/CodeSnippets.md § copy-paste-return that has not been validated — it doesn’t have to be this way: dylanaraps/pure-sh-bible@9d54e96011
.
dotfiles/.oh-my-zsh/custom/aliases.zsh
Lines 17 to 30 in 124227f
this part of the cleanup
function should add a line
-name '.zcompdump-*' or \
to remove cruftily named .zcompdump
files such as .zcompdump-oin-5.4.2
or .zcompdump-LPhoneXSMax-5.8
.
dotfiles/.oh-my-zsh/custom/aliases.zsh
Lines 185 to 193 in 8c86bfd
A timeline-based software such as Git requires no previous versions of existing files, nor does it need example or sample files such as these:
There’s no list of globally installed Node packages analogous to Homebrew’s, there is one being generated by LucasLarson/update@f651abb58a
and saved to $DOTFILES/.package-list.json.
invoking Korn shell with ksh
or ksh93
and granting Korn shell access to $SHELL
’s $HISTFILE
can corrupt or destroy $HISTFILE
.
I’m unable to create a reproducible example.
# remove branches already merged into default branch
# https://github.com/mathiasbynens/dotfiles/commit/6c16e6b
alias gDM="!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
gdm
is set to git diff <default branch>
Line 1 in 9a9da28
Merge the profiles of authors committing from multiple email addresses, prompted especially by @github’s @users.noreply.github.com
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
dotfiles/.oh-my-zsh/custom/aliases.zsh
Line 190 in 2a6181d
Even empty directories keep a size (64 b in my testing), and I suspect that is what prevented find
from seeing it.
Add autosuggestions like fish provides which are sort of available for Z shell.
edit
is not at all portable here:
dotfiles/.oh-my-zsh/custom/aliases.zsh
Lines 224 to 227 in 9c37ff8
A solution like ${EDITOR:-vi}
¹ instead of edit
² is portable and should replace it.
/usr/bin/vi
, but it’s closeedit
is defined as:Lines 8 to 20 in 9c37ff8
The Apache Commons Codec package contains simple encoder and decoders for various formats such as Base64 and Hexadecimal. In addition to these widely used encoders and decoders, the codec package also maintains a collection of phonetic encoding utilities.
Path to vulnerable library: /dotfiles/Library/Application Support/PyCharm2019.3/datalore-intellij-plugin/lib/commons-codec-1.10.jar
Dependency Hierarchy:
Found in HEAD commit: 6b2f9295e9052a76034fb8cf630271b237f4ac7c
Apache commons-codec before version “commons-codec-1.13-RC1” is vulnerable to information disclosure due to Improper Input validation.
Publish Date: 2019-05-20
URL: WS-2019-0379
Base Score Metrics:
Type: Upgrade version
Origin: apache/commons-codec@48b6157
Release Date: 2019-05-12
Fix Resolution: 1.13-RC1
Step up your Open Source Security Game with WhiteSource here
Consider upgrading ${HOME-}
references1 to ${HOME%/}
2 to avoid $PATH
pollution.3
The Single UNIX Specification, version 4,4 says that “[i]f a pathname begins with two successive slash characters, the first component following the leading slash characters may be interpreted in an implementation-defined manner” (via) ↩
Single UNIX Specification, Version 4: Base Definitions § 4.13 Pathname Resolution ↩
Leah Neukirchen serves decimal time using Ruby;1 this utility should be available here, too, but should use only POSIX-defined tools and options
from 0b2d044dd4
, 2021-02-25:
Lines 20 to 24 in 913708d
from c66f3bcefd
, 2020-12-26:
Lines 346 to 348 in 913708d
It was a mistake to call cp
instead of command cp
in LucasLarson/dotfiles@ee3c5bfd59
.
cp
(and grep
) are super likely to be in alias definitions which means their functionality loses idempotence in shell scripts.
Vim uses ~/.vimrc
according to @HiPhish¹, whereas Neovim uses $XDG_CONFIG_HOME/init.vim
this repository:
0812e27 replaced /usr/local
with $BREW_PREFIX
, generated here:
Line 171 in 0812e27
Meanwhile at @Homebrew, there is a strong preference for $HOMEBREW_PREFIX
:
search results1 | query |
---|---|
529 | "HOMEBREW_PREFIX" |
3 | "BREW_PREFIX" |
This repository should match theirs.
if not, then consider:¹
command -v brew >/dev/null 2>&1 &&
[ -d "$(brew --prefix coreutils)" ] &&
PATH="$(brew --prefix coreutils)/libexec/gnubin:${PATH}" &&
export PATH
"$(brew --prefix)"
| "$(brew --prefix coreutils)"
| ||
---|---|---|---|
macOS | Intel | /usr/local ²
| /usr/local/opt/coreutils
|
ARM | /opt/homebrew ²
| /opt/homebrew/opt/coreutils
| |
Linux | /home/linuxbrew/.linuxbrew ²
| /home/linuxbrew/.linuxbrew/opt/homebrew
|
This repository should use unset ‑v
instead of unset
when unsetting variables to ensure better compatibility, portability, and maintainability:
unset ‑v
has been part of the POSIX specification for at least a quarter century andthe current version of GitHub’s Super-Linter is v4.10.1 but I just
learned that Super-Linter’s latest tag is not synonymous with its
newest tag or release: there are 50 files changed in
github/super-linter@latest...v4.10.1
while leaping to the bleeding edge of software is not appropriate for
every repository, it would probably be preferable here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.