jq is useful to slice, filter, map and transform structured json data.
brew install jq
People
![]() :bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
git log --oneline -1 <PR-BRANCH>
git push -f origin :
#!/bin/sh | |
IN=LVDS-0; | |
setoff() { | |
for display in `xrandr | awk '/ disconnected/ {print $1}'`; do | |
echo "maybe disabling $display"; | |
xrandr --output $display --off; | |
done; | |
} |
#!/bin/sh | |
PATH_TO_ACCOUNT="/path/to/account" | |
PATH_TO_FILE="/path/to/file" | |
ACCOUNT_NAME="[email protected]" | |
ISSUER="Somewhere Org" | |
KEEPASS_PASSWORD="the secret password" | |
echo "$KEEPASS_PASSWORD" | keepassxc-cli show -a "TOTP Seed" "$PATH_TO_FILE" "$PATH_TO_ACCOUNT" | grep -v "Insert password" | while read i;do echo "otpauth://totp/$ACCOUNT_NAME?secret=$i&issuer=$ISSUER" | qr;done; |
# aproducer.py | |
# | |
# Async Producer-consumer problem. | |
# Challenge: How to implement the same functionality, but no threads. | |
import time | |
from collections import deque | |
import heapq | |
class Scheduler: |
from pydantic import BaseModel | |
import inspect | |
def optional(*fields): | |
def dec(_cls): | |
for field in fields: | |
_cls.__fields__[field].required = False | |
return _cls |
import unittest | |
from functools import wraps | |
from unittest import mock | |
def log(*args, **kwargs): | |
""" Logging function """ | |
def print_debug(*args, **kwargs): |
import psycopg2 | |
import json | |
def main(): | |
with psycopg2.connect("host=localhost port=15432 " | |
"dbname=mydb user=postgres password=postgres") as conn: | |
#insertByObject(conn) | |
#insertByText(conn) | |
#select(conn) |