~evan-hoose/Snippets

Some random snippets I keep around.
a0a42aea — Evan Hoose 5 months ago
Committer: Evan Hoose <evan@a-shared-404.com>
02fa36a6 — Evan Hoose 5 months ago
Committer: Evan Hoose <evan@a-shared-404.com>
 On branch master

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~evan-hoose/Snippets
read/write
git@git.sr.ht:~evan-hoose/Snippets

You can also use your local clone with git send-email.

#Some useful(?) code snippets.

This is literally just a collection of some bits and pieces that don't fit anywhere else.

##resume_gen.sh

The script I use to generate my resume from a markdown formatted text file.

##isPhoneNumber.php

PHP function to validate a phone number from untrusted input. That's all it does. I'm not a PHP expert, so I'd recommend you check over it yourself.

##shell.rs

Rust function to execute a command in a shell. Just pass it an &str for the command, and it'll push it on to sh -c. It'll only work in POSIX compatible environments, and if you take untrusted user input it could result in command injection. Also, it'll hold the thread until the command finishes.