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
@VsevolodGolovanov
VsevolodGolovanov / gist:7da8c08f8207c1c563120423cb723342
Last active June 29, 2024 12:12
Must app export profile data
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); })();
Now your clipboard contains a list of Tab separated movie titles and ratings.
For Series (includes number of unwatched episodes after another Tab, if not finished):
(() => { let exportResult = ""; $('.js_item_product').each((i, el) => exportResult += $(el).find('.poster__title').text() + '\t' + $(el).find('.poster__rate_stars').text().trim() + '\t' + $(el).find('.poster__rate_progress').text().trim() + '\n'); copy(exportResult); })();
@FradSer
FradSer / iterm2_switch_automatic.md
Last active June 20, 2024 14:14
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:
@majackson
majackson / migrations.md
Last active July 22, 2024 16:29
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.
#!/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
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active July 15, 2024 19:07
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@mlavin
mlavin / NOTES.rst
Created September 23, 2013 14:17
Celery Late Ack Example

Running the Example

Start the worker:

celery -A tasks worker --loglevel=info -c 2 --pidfile=celery.pid

In another terminal send 6 tasks:

python script.py
@ju-popov
ju-popov / timestamp.py
Last active April 7, 2021 16:09
Python DateTime / Timestamp Convertion
######################################################################
# CURRENT AWARE LOCAL DATETIME
######################################################################
from datetime import datetime
from tzlocal import get_localzone
local_tz = get_localzone()
local_dt = datetime.now(local_tz)
@return1
return1 / trim_enabler.txt
Last active May 26, 2024 11:01
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
@ibeex
ibeex / foo.log
Created August 4, 2012 13:46
Flask logging example
A warning occurred (42 apples)
An error occurred