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: |
"""Utilities for managing database sessions.""" | |
from __future__ import with_statement | |
import contextlib | |
import functools | |
@contextlib.contextmanager | |
def temp_session(session_cls, **kwargs): | |
"""Quick and dirty context manager that provides a temporary Session object | |
to the nested block. The session is always closed at the end of the block. |
""" | |
This script demonstrates the use of nested transactions in SQLAlchemy, including | |
a workaround for an issue with the SQLite backend. | |
References: | |
http://docs.sqlalchemy.org/en/latest/orm/session_transaction.html#using-savepoint | |
http://docs.sqlalchemy.org/en/latest/dialects/sqlite.html#serializable-isolation-savepoints-transactional-ddl | |
""" | |
from sqlalchemy import Column, String, Integer |
-- http://stackoverflow.com/questions/1124603/grouped-limit-in-postgresql-show-the-first-n-rows-for-each-group | |
-- http://www.postgresql.jp/document/9.2/html/tutorial-window.html | |
CREATE TABLE empsalary ( | |
depname varchar(10) not null | |
, empno integer not null | |
, salary integer not null | |
); | |
INSERT INTO empsalary (depname, empno, salary) VALUES ('develop', 11, 5200); |