Skip to content

Instantly share code, notes, and snippets.

@eoranged
eoranged / main.py
Created September 27, 2021 10:30
LibCST example for Moscow Python Conf++ 2021
RESULTS = {}
def add_and_store(a, b, name):
"""Process and save to DB"""
result = a + b
RESULTS[name] = result
def add(a, b):
@eoranged
eoranged / pre-commit-no-print.sh
Created September 20, 2019 14:33
Pre commit hook to check python files for print statements/functions
#!/bin/sh
# BSD regex for finding Python print statements
find_print='\+[[:space:]]*print[[:space:](]'
# Save output to $out var
out=`git diff --staged | grep -e ${find_print}`
# Count number of prints
count=`echo "${out}" | grep -e '\w' | wc -l`
@eoranged
eoranged / task_to_commit.sh
Last active September 20, 2019 14:23
Add task Id to git commit message
#!/bin/bash
# Git prepare-commit-msg hook to add Jira-formatted task ID from branch name to commit message
# Save as .git/hooks/prepare-commit-msg
# Or do
#
# ln -s /path/to/task_to_commit.sh project_root/.git/hooks/prepare-commit-msg
#
# To enable for all repos:
#
(require 'quail)
(defun reverse-input-method (input-method)
"Build the reverse mapping of single letters from INPUT-METHOD."
(interactive
(list (read-input-method-name "Use input method (default current): ")))
(if (and input-method (symbolp input-method))
(setq input-method (symbol-name input-method)))
(let ((current current-input-method)
(modifiers '(nil (control) (meta) (control meta))))
(when input-method

Keybase proof

I hereby claim:

  • I am eoranged on github.
  • I am eoranged (https://keybase.io/eoranged) on keybase.
  • I have a public key whose fingerprint is 320D 56BC 2A41 58C0 FCE4 3668 A612 1218 E49D 9553

To claim this, I am signing this object: