Skip to content

Instantly share code, notes, and snippets.

Avatar

nntrn

  • Austin, TX
View GitHub Profile
View ascii-pie-chart.js
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 Jul 28, 2022
python oneliners
View python-one-liners.sh
#!/usr/bin/env bash
#+============================================================================
# $ echo "import this" | python
#+============================================================================
# The Zen of Python, by Tim Peters
# Beautiful is better than ugly.
# Explicit is better than implicit.
# Simple is better than complex.
# Complex is better than complicated.
@nntrn
nntrn / gist-files-jq.sh
Last active Aug 12, 2022
jq snippets taken from man page
View gist-files-jq.sh
# 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)"'
)"
View red_hat_enterprise_linux.json
[
{
"outerText": [
"Listing available system locale settings:",
"",
"$ localectl list-locales"
],
"runasroot": false
},
{
@nntrn
nntrn / handy-ansible.sh
Last active Aug 18, 2021
handy command line ansible snippets
View handy-ansible.sh
# 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
# ==============================================================================
View ad-hoc-commands.sh
# 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 Jan 11, 2022
Extended summary for aggregating data @datalib
View datalib-extended-summary.js
var dl = require('datalib')
const getSummary = {
maxValuesToInclude: 25,
config: {
maxValuesToInclude: 25,
showPercent: true,
},
keys: function (x) {
@nntrn
nntrn / espn-api-list.md
Last active Aug 17, 2022
list of nfl api endpoints from espn
View espn-api-list.md

List of NFL API Endpoints

View updated list here

This page is limited to NFL endpoints but can be refashioned for other sports leagues (i.e. /sports/football/leagues/nfl/ => /sports/baseball/leagues/mlb/)


Getting started