Skip to content

Instantly share code, notes, and snippets.

@izidormatusov
izidormatusov / redirect.vim
Created June 20, 2018 08:17
Redirect output into the file in vim
redir @">
ls
redir END
normal p
# HTTP request in plain bash
exec 3<>/dev/tcp/tangentlabs.co.uk/80
echo -e "GET / HTTP/1.1" >&3
echo -e "Host: tangentlabs.co.uk" >&3
echo -e "Connection: close" >&3
echo -e "\n" >&3
cat <&3
@izidormatusov
izidormatusov / add-missing-load-i18n.sh
Last active August 29, 2015 13:56
Add {% load i18n %} to templates which are missing it
# Add {% load i18n %} to templates which are missing it
#
# How this works?
# Step 1: Find all files in templates folder
# Step 2: Print file name of that file if file has at least one trans or blocktrans tag
# Step 3: Put load tag on the first or second line, depending if the first line is extends tag
#
# Elaborate on the third step:
#
# 1 { # Operate only on the first line