Skip to content

Commit

Permalink
Update rc_awesome.xsh
Browse files Browse the repository at this point in the history
  • Loading branch information
anki-code authored May 27, 2024
1 parent 8ba6cf4 commit 541694f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xontrib/rc_awesome.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ imp = type('ImpCl', (object,), {'__getattr__':lambda self, name: __import__(name
# See also - https://github.com/anki-code/xonsh-cheatsheet/blob/main/README.md#transparent-callable-environment-variables
$dt = type('TimeCl', (object,), {'__repr__':lambda self: imp.datetime.datetime.now().isoformat() })()

# Macro call sugar.
# Usage:
# j = from_json!(echo '{"a":1}') # returns dict
#
from_json = lambda cmd: __import__("json").loads(evalx(f"$({cmd})"))


# ------------------------------------------------------------------------------
# Conda (https://conda-forge.org/)
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 541694f

Please sign in to comment.