Remove 'selector-16' which the macos emoji picker inserts, and handle it being present

This commit is contained in:
2021-12-20 22:48:10 -08:00
parent c06ca5dad2
commit c7e09adba2
10 changed files with 130 additions and 65 deletions

View File

@@ -1,9 +1,9 @@
# ⚡-runner: the minimal task runner you've been missing in your life
-runner is a language-agnostic task runner in the category of tools such as `make`, `grunt`, `gradle`, `leiningen`, etc. It has a single, widely available dependency: bash.
# ⚡-runner: the minimal task runner you've been missing in your life
⚡-runner is a language-agnostic task runner in the category of tools such as `make`, `grunt`, `gradle`, `leiningen`, etc. It has a single, widely available dependency: bash.
It's intent is to provide your shell scripts with the syntactic sugar they crave to make them more presentable, and more manageable.
# Why have you done this?
The main reason ⚡-runner was born, was because I'm a huge fan of [go scripts](https://blog.thepete.net/blog/2014/03/28/_-attributes-of-an-amazing-dev-toolchain/). I find myself including one in nearly every repo I make. I've also started finding myself copy-pasting a WHOLE bunch of helper functions across them. These scripts are always in bash to make them easily usable by everyone on a team, regardless of their operating system of choice. I've also found myself using similar patterns for other scripts I have, which do maybe more than a single thing but maybe less than a full application would warrant.
The main reason ⚡-runner was born, was because I'm a huge fan of [go scripts](https://blog.thepete.net/blog/2014/03/28/_-attributes-of-an-amazing-dev-toolchain/). I find myself including one in nearly every repo I make. I've also started finding myself copy-pasting a WHOLE bunch of helper functions across them. These scripts are always in bash to make them easily usable by everyone on a team, regardless of their operating system of choice. I've also found myself using similar patterns for other scripts I have, which do maybe more than a single thing but maybe less than a full application would warrant.
# Usage
Download the runner, chuck it into your repo, and source it from a shell script!
@@ -12,18 +12,18 @@ Download the runner, chuck it into your repo, and source it from a shell script!
# Now it's time for some documentation-driven development! (a.k.a. usage examples)
a.k.a. Literally none of this works.
## Hello ⚡
## Hello ⚡
As is tradition:
```bash
$ echo '
#!/usr/bin/env bash
hello() {
⚡hello() {
_help-line "Say hello!"
echo Hello, world!
}
source ⚡
source ⚡
' > go && chmod +x go
$ ./go hello
Hello, world!
@@ -41,35 +41,35 @@ Look! It's like a task runner!
#!/usr/bin/env bash
cd $(dirname $0)
build() {
⚡build() {
echo "echo hi" > .generated/potato
chmod +x .generated/potato
}
run() {
build
⚡run() {
⚡build
.generated/potato "$@"
}
check() {
build
⚡check() {
⚡build
shellcheck .generated/potato
}
test() {
build
⚡test() {
⚡build
[ "$(.generated/potato)" == "hi" ]
}
clean() {
⚡clean() {
rm -rf .generated
}
source
source
```
## It's just bash!
Do whatever you need, just define a ⚡function or two as the interface
Do whatever you need, just define a ⚡function or two as the interface
```bash
#!/usr/bin/env bash
@@ -82,13 +82,13 @@ router-curl() {
curl -s -b $cookie_jar_path -c $cookie_jar_path -X POST "http://192.168.0.1/cgi-bin/luci/;stok=${STOK:-}/$path" "$@"
}
connected-devices() {
⚡connected-devices() {
_help-line "Show devices connected to router"
STOK=$(router-curl login?form=login --data-raw "operation=login&password=$encrypted_password"| jq -r .data.stok )
router-curl admin/status?form=all | jq '.data | [.access_devices_wired, .access_devices_wireless_guest, .access_devices_wireless_host] | flatten'
}
source
source
```
# More sugar
@@ -97,15 +97,15 @@ source ⚡️
$ echo '
#!/usr/bin/env bash
good() {
⚡good() {
_good-message + Good Message
}
bad() {
⚡bad() {
_bad-message - Bad Message
}
source ⚡
source ⚡
' > go && chmod +x go
$ ./go good
+ Good message
@@ -122,11 +122,11 @@ _verify-prerequisites() {
docker ps &> /dev/null || (echo 'Not enough docker'; exit 1)
}
ubuntu() {
⚡ubuntu() {
docker run -ti ubuntu
}
source ⚡
source ⚡
' > go && chmod +x go
$ ./go ubuntu
Not enough docker
@@ -147,11 +147,11 @@ kubectlw() {
-d https://dl.k8s.io/release/VERSION/bin/darwin/amd64/kubectl
}
kubectl-version() {
⚡kubectl-version() {
kubectlw version
}
source ⚡
source ⚡
' > go && chmod +x go
$ ./go kubectl-version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.4", GitCommit:"d360454c9bcd1634cf4cc52d1867af5491dc9c5f", GitTreeState:"clean", BuildDate:"2020-11-11T13:17:17Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"darwin/amd64"}
@@ -160,16 +160,16 @@ The connection to the server localhost:8080 was refused - did you specify the ri
```
# Appendix
This is where I would put the full list of helpers ⚡-runner provides IF I HAD ONE
This is where I would put the full list of helpers ⚡-runner provides IF I HAD ONE
# FAQ
## How do I type ⚡?
## How do I type ⚡?
Below this line are a number of options. Go down the list until you find one that works for you.
- ^⌘Space on macos opens the emoji picker. Search for 'lightning'
- ⊞Win + . on windows opens the emoji picker. Search for 'lightning'
- ctrl + . within gnome opens the emoji picker. Search for 'lightning' (can someone confirm?)
- Super + . within KDE opens the emoji picker. Search for 'lightning' (can someone confirm?)
- Copy and paste this: ⚡
- Copy and paste this: ⚡
- Use your favorite web search engine to search for 'lightning emoji', copy paste from there.
## Why bash?
Because I like it.