Skip to content

Instantly share code, notes, and snippets.

View Sinkler's full-sized avatar
:octocat:
Saluton!

Anton Shurashov Sinkler

:octocat:
Saluton!
View GitHub Profile
#!/bin/bash
count=`git tag -l | wc -l`
keep=20
num=0
for t in `git tag -l --sort=taggerdate`
do
if [ "$num" -ge `expr $count - $keep` ]
then
@majackson
majackson / migrations.md
Last active May 2, 2025 17:50
Django migrations without downtime

Django Migrations without Downtime

The following instructions describe a set of processes allowing you to run Django database migrations against a production database without having to bring the web service down.

Note that in the below instructions, migrations are all run manually at explicit points, and are not an automatic part of the deployment process.

Adding Fields or Tables

Adding a (nullable) field or a new table

  1. Make the model or column addition in your code.
@FradSer
FradSer / iterm2_switch_automatic.md
Last active April 6, 2025 09:19
Switch iTerm2 color preset automatic base on macOS dark mode.

The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.

Vist iTerm2 homepage or use brew install iterm2-beta to download the beta. Thanks @stefanwascoding.


  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
@VsevolodGolovanov
VsevolodGolovanov / gist:7da8c08f8207c1c563120423cb723342
Last active April 28, 2025 23:45
Must app export profile data
Update: just use this: https://mustapp-exporter.pages.dev/
Original Developer Tools way follows (but it doesn't export reviews).
Here's how to export your movie history from Must, just in case it goes under.
Go to https://mustapp.com/@<your_profile_name>/watched
Scroll down (hold End on keyboard) until the whole list is loaded.
Open Browser Developer Tools, Console.
Paste the following line and press Enter:
(() => { let exportResult = ""; $('.js_item_product').each((i, el) => exportResult += $(el).find('.poster__title').text() + '\t' + $(el).find('.poster__rate').text().trim() + '\n'); copy(exportResult); })();