Skip to content

Instantly share code, notes, and snippets.

View nntrn's full-sized avatar

nntrn

View GitHub Profile
@nntrn
nntrn / git-ref.sh
Last active April 24, 2024 05:27
Handy git commands
########################################################################
# _ _ __
# (_) | / _|
# __ _ _| |_ _ __ ___| |_
# / _` | | __| | '__/ _ \ _|
# | (_| | | |_ | | | __/ |
# \__, |_|\__| |_| \___|_|
# __/ |
# |___/ by @nntrn
#
function piechart(data, radius=10) {
var k = Object.keys(data)
var v = Object.values(data)
var r = radius
d = r * 2;
M = Math;
R = M.round;
p = [];
for (y = 0; y < d; y++) {
p[y] = [];
@nntrn
nntrn / python-one-liners.sh
Last active April 12, 2024 22:38
python oneliners
#!/usr/bin/env bash
### ALIAS ##########################################################################################
# Notes:
# Most aliases accept both standard input and command-line arguments
# Examples:
# $ echo ':hello world' | urlquote
# $ urlquote ':hello world'
@nntrn
nntrn / gist-files-jq.sh
Last active October 8, 2022 09:38
jq snippets taken from man page
# Write gist files using jq
GIST_ID=b787f3e14f28de11af45b1c7ec0ffbbc
eval "$(
curl -s https://api.github.com/gists/$GIST_ID |
jq -r '.files | to_entries | .[].value | @sh "echo \(.content) | tee \(.filename)"'
)"
[
{
"outerText": [
"Listing available system locale settings:",
"",
"$ localectl list-locales"
],
"runasroot": false
},
{
@nntrn
nntrn / handy-ansible.sh
Last active August 18, 2021 07:10
handy command line ansible snippets
# NOTES
# ansible [pattern] -m [module] -a "[module options]"
# add `--tree <foldername>` to store output in directory
# add `-i <inventory_file>` if inventory is not specified in ansible.cfg
# ==============================================================================
# GETTING FACTS
# ==============================================================================
# source:
# https://ansible-tips-and-tricks.readthedocs.io/en/latest/ansible/commands/
# Ping hosts
ansible <HOST_GROUP> -m ping
# Display gathered facts
ansible <HOST_GROUP> -m setup | less
# Filter gathered facts
@nntrn
nntrn / datalib-extended-summary.js
Last active January 11, 2022 08:36
Extended summary for aggregating data @datalib
var dl = require('datalib')
const getSummary = {
maxValuesToInclude: 25,
config: {
maxValuesToInclude: 25,
showPercent: true,
},
keys: function (x) {
@nntrn
nntrn / espn-api-list.md
Last active November 14, 2024 21:53
List of nfl api endpoints from espn

List of NFL API Endpoints

This page has been updated a lot in the past 3 years. Older revisions you might like more than this one:

  • June 2021 - list of endpoints for other sports/leagues (i.e. basketball, baseball, lacrosse, rugby)
  • August 2021 - get historical fantasy league data
  • September 2021 - list of endpoints in plain text
  • May 2023 - collapsed endpoint response examples

Additional Resources