Skip to content

Instantly share code, notes, and snippets.

@orzFly
orzFly / script-template.sh
Created December 15, 2020 12:20 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
trap cleanup SIGINT SIGTERM ERR EXIT
usage() {
cat <<EOF
@orzFly
orzFly / README.md
Created July 13, 2017 09:02 — forked from joyrexus/README.md
Nested grouping of arrays

nest

A multi-level groupBy for arrays inspired by D3's nest operator.

Nesting allows elements in an array to be grouped into a hierarchical tree structure; think of it like the GROUP BY operator in SQL, except you can have multiple levels of grouping, and the resulting output is a tree rather than a flat table. The levels in the tree are specified by key functions.

@orzFly
orzFly / Appex.c
Created March 9, 2017 16:50 — forked from blackgear/Appex.c
Generate license for AppEX
#include <net/if.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
int main() {
int fd;
struct ifreq ifr;