As configured in my dotfiles.
start new:
tmux
start new with session name:
| import contextlib | |
| import OpenSSL.crypto | |
| import os | |
| import requests | |
| import ssl | |
| import tempfile | |
| @contextlib.contextmanager | |
| def pfx_to_pem(pfx_path, pfx_password): | |
| ''' Decrypts the .pfx file to be used with requests. ''' |
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
| """ | |
| This is a batched LSTM forward and backward pass | |
| """ | |
| import numpy as np | |
| import code | |
| class LSTM: | |
| @staticmethod | |
| def init(input_size, hidden_size, fancy_forget_bias_init = 3): |
| #!/bin/bash | |
| # Thanks goes to @pete-otaqui for the initial gist: | |
| # https://gist.github.com/pete-otaqui/4188238 | |
| # | |
| # Original version modified by Marek Suscak | |
| # | |
| # works with a file called VERSION in the current directory, | |
| # the contents of which should be a semantic version number | |
| # such as "1.2.3" or even "1.2.3-beta+001.ab" |
| from __future__ import annotations | |
| from typing import Any, Dict, Iterable, Mapping, MutableMapping, MutableSequence, Union | |
| class AttrDict: | |
| """ | |
| A class with both dictionary and attribute style access to it's data member. | |
| It can be used in `RestrictedPython <http://restrictedpython.readthedocs.io/>`_ |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
As configured in my dotfiles.
start new:
tmux
start new with session name: