Skip to content

Instantly share code, notes, and snippets.

@peterdemin
peterdemin / update_deps.py
Created December 29, 2017 21:08
Build locked python requirements files for multiple environments
#!/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 / food.txt
Created July 19, 2018 00:31
List of food items
abiyuch
acerola
acorn
agave
agents
agutuk
alfalfa
amaranth
animal
apache
@peterdemin
peterdemin / django-tms.md
Last active September 13, 2018 18:09
Django-TMS

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 / .bashrc
Created November 1, 2019 13:43
My bashrc file from NCBI
#!/usr/bin/env bash
# bash history
export HISTFILESIZE=99999
export HISTSIZE=99999
# solarized
export TMUX="screen-256color"
# vim
@peterdemin
peterdemin / diary
Created February 4, 2022 17:19
SH script to append text to a file and synchronize it using git
#!/bin/sh
DIARY_DIR=~/diary
DIARY_FILE=README.md
cd ${DIARY_DIR}
git pull -q
echo >> ${DIARY_FILE}
date >> ${DIARY_FILE}
echo >> ${DIARY_FILE}