Skip to content

Instantly share code, notes, and snippets.

@datfinesoul
datfinesoul / README.md
Last active November 24, 2022 07:02
Use `jq` to take a JSON object and export it as environment variables

There is extra code in here, but the key takeaway is:

  1. Use jq to convert an object with key/value pairs, into a key=value string list
  2. Feed that listinto a while loop, which then exports the environment variables

While this is done in a script, it needs to live in a function, if the environment variables are supposed to persist in the current shell.

@stober
stober / softmax.py
Created March 1, 2012 03:05
Softmax in Python
#! /usr/bin/env python
"""
Author: Jeremy M. Stober
Program: SOFTMAX.PY
Date: Wednesday, February 29 2012
Description: Simple softmax function.
"""
import numpy as np
npa = np.array