(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
// create a menu | |
function onOpen() { | |
var menuEntries = [ {name: "Create invoice", functionName: "CreateInv"}]; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
ss.addMenu("Invoice Generator", menuEntries); | |
} | |
function CreateInv() { | |
// specify doc template and get values from spread |
[alias] | |
co = checkout | |
br = branch | |
ci = commit | |
st = status | |
unstage = reset HEAD -- | |
undo = reset --soft HEAD~1 | |
last = log -1 HEAD | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%C | |
reset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches |
from time import sleep | |
from timed_cache import Memoize | |
def test_memoize(): | |
""" | |
Test if the cached function results expires in the expected time. | |
""" |
Yubikey, Smart Cards, OpenSC and GnuPG are pain in the ass to get working. Those snippets here sould help alleviate pain.
To reset and disable not used modes on Yubikey you need the ykman
program
You can install it using those commands
import os | |
import logging | |
from typing import Dict, List | |
import boto3 | |
from botocore.exceptions import ClientError | |
class CloudWatchRules: |
import time | |
from flask import Request | |
from google.cloud import pubsub_v1 | |
from lib.logger import get_logger | |
logger = get_logger(__name__) | |
""" | |
Recapitalize a string of words that has passed a pre-processing, word-cuttind and case lowering process. | |
""" | |
import re | |
import difflib | |
from typing import Iterator, List, Tuple | |
def recapitalize_name(original: str, result: str) -> str: | |
"""Return the `result` with the words capitalized as they appear in `original`.""" |
""" | |
pip install boto3 'boto3-stubs[ssm]' | |
""" | |
from typing import TYPE_CHECKING | |
import boto3 | |
if TYPE_CHECKING: | |
from mypy_boto3_ssm.client import SSMClient |
#!/usr/bin/env bash -x | |
# | |
# Script to remove GPG user (recipient) with git-crypt | |
# | |
# It will re-initialize git-crypt for the repository and re-add all keys except | |
# the one requested for removal. | |
# | |
# Note: You still need to change all your secrets to fully protect yourself. | |
# Removing a user will prevent them from reading future changes but they will | |
# still have a copy of the data up to the point of their removal. |