Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Demin peterdemin

View GitHub Profile
@peterdemin
peterdemin / .bashrc
Created Nov 1, 2019
My bashrc file from NCBI
View .bashrc
#!/usr/bin/env bash
# bash history
export HISTFILESIZE=99999
export HISTSIZE=99999
# solarized
export TMUX="screen-256color"
# vim
View django-tms.md

Django Text Management System

Motivation

Django templates often contain text/media that doesn't affect application's functionality. These texts belong to product people, but because they are stored in template files, are modified by developers. Such editing is slow and continious delivery pipelines treat it the same way as code changes.

How things used to be

@peterdemin
peterdemin / food.txt
Created Jul 19, 2018
List of food items
View food.txt
abiyuch
acerola
acorn
agave
agents
agutuk
alfalfa
amaranth
animal
apache
@peterdemin
peterdemin / update_deps.py
Created Dec 29, 2017
Build locked python requirements files for multiple environments
View update_deps.py
#!/usr/bin/env python
"""
Build locked requirements files for each of:
base.in
test.in
local.in
External dependencies are hard-pinned using ==
Internal dependencies are soft-pinned using ~=
".post23423" version postfixes are truncated
@peterdemin
peterdemin / commit-msg
Created Dec 29, 2017
Git commit-msg hook, that adds Jira ticket number from branch name to each commit message
View commit-msg
#!/bin/sh
ticket=$(git symbolic-ref HEAD | grep -o 'ND-[0-9][0-9]*')
if [ -n "${ticket}" ]; then
grep -qs "^ *${ticket}" "${1}" || (echo >> "${1}" && echo "${ticket}" >> "${1}")
fi
@peterdemin
peterdemin / kibitzr.yml
Created May 27, 2017
Stash aggregation
View kibitzr.yml
transform:
- jinja: |
{%- set bofa = stash.bofa_credit | float -%}
{%- set discover = stash.discover | float -%}
{%- set amex = stash.amex | float -%}
{%- set checking = stash.bofa_checking | float -%}
{%- set savings = stash.bofa_savings | float -%}
{%- set credits = bofa + discover + amex -%}
{%- set total = -bofa - discover - amex + checking + savings -%}
```text
@peterdemin
peterdemin / kibitzr.yml
Created May 27, 2017
Banks aggregation
View kibitzr.yml
checks:
- name: bofa
url: https://www.bankofamerica.com/
form:
- id: onlineid1
creds: keyring.bofa.username
- id: passcode1
creds: keyring.bofa.password
- id: hp-sign-in-btn
View kibitzr.yml
checks:
- name: TD
url: https://onlinebanking.tdbank.com/
form:
- id: txtUser
value: creds.td.username
- id: txtPassword
value: creds.td.password
transform:
- css: #balance
View kibitzr.yml
checks:
- name: Discover
url: https://www.discover.com/
form:
- id: userid
creds: discover.login
- id: password
creds: discover.password
delay: 5
transform:
@peterdemin
peterdemin / kibitzr.yml
Created May 6, 2017
American Express check
View kibitzr.yml
checks:
- name: AmEx
url: https://www.americanexpress.com/
form:
- id: Username
creds: amex.username
- id: Password
creds: amex.password
- id: loginLink
click: true