Skip to content

Instantly share code, notes, and snippets.

View Microphone mute hotkey on
  1. Open
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
deniskrumko /
Created April 4, 2019 10:20
Python things

Python - динамический интерпретируемый язык

Можно присвоить значение одной функции - другой функции

foo.__code__ = bar.__code__
zmts /
Last active March 30, 2023 10:40
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
pbabics /
Created November 11, 2016 13:13
Manual garbage collector for gitlab registry, it removes old revisions that are not referenced by any tag
GITLAB_CTL_COMMAND=`which gitlab-ctl`
eirnym /
Created April 11, 2015 17:38
SQLAlchemy dump SQL and metadata create_all and drop_all usage example. This is highly usable with aiopg and similar library where synchronised version of engine is not applicable.
from sqlalchemy_dump import dump_sql
def create_all_sql(metadata):
return dump_sql(metadata.create_all, bind=True)()
def drop_all_sql(metadata):
return dumpsql(metadata.drop_all, bind=True)()
ruario /
Last active January 7, 2023 20:52
Installs (or updates) PPAPI Flash, so that it can be used by Chromium-based browsers


If you use Ubuntu or a derivative distro, issue the following to install an appropriate version of Flash:

sudo add-apt-repository "deb `lsb_release -cs` partner" 
sudo apt update
sudo apt install adobe-flashplugin

If your distro does not provide a copy of Pepper Flash that works with Vivaldi, this script will download and install it for you. To use, click on the "Download ZIP" button listed on the GitHub Gist page and then unpack the .zip archive locally. You should now have a directory containing the file "".

nealtodd /
Last active November 14, 2019 01:25
Skip migrations for a Django 1.7 test run
# If your test settings file doesn't import any other settings file
# then you can use the function directly:
def prevent_tests_migrate(db):
import django
from django.db import connections
from django.db.migrations.executor import MigrationExecutor
ma = MigrationExecutor(connections[db]).loader.migrated_apps
return dict(zip(ma, ['{a}.notmigrations'.format(a=a) for a in ma]))