Skip to content

Instantly share code, notes, and snippets.

View Neved4's full-sized avatar
♦️
843D 097F DB05 B7F3 F65D

⑆ Neveda ⑈ Neved4

♦️
843D 097F DB05 B7F3 F65D
  • /bin/sh
  • Europe
  • 20:12 (UTC +02:00)
View GitHub Profile
@Neved4
Neved4 / is-curl.sh
Last active July 3, 2024 18:44
Check whether script was sourced from curl
#!/bin/sh
# usage: curl -fsSL https://gist.githubusercontent.com/<user>/<id>/raw/<id>/is-curl.sh | sh -s -- --from-curl
curl=false
case "$@" in
-c|--from-curl) curl=true
esac
@Neved4
Neved4 / human.rs
Created October 1, 2023 11:01
Understandable Errors
// Rust errors help developers understand problems with their code.
error: `life` does not live long enough
--> src/human.rs:74:4
|
74 | life.do_something_productive();
| ^^^^ does not live long enough
92 | }
| - your life lasts until here, while the crab is immortal