Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bennewton999
bennewton999 / dailyNoteTemplate.txt
Last active January 9, 2024 09:49
My current Daily Note Template in Obsidian utilizing Templater and DataView Plugins
---
creation date: <% tp.file.creation_date() %>
tags: DailyNote <% tp.file.title.split('-')[0] %>
---
modification date: <%+ tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm:ss") %> // This doesn't currently work in front matter, hoping that gets fixed.
# <% tp.file.title %>
<< [[<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>]] | [[<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>]]>>
  1. Open Automator.app
  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
deniskrumko / python.md
Created April 4, 2019 10:20
Python things

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


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

foo.__code__ = bar.__code__
@zmts
zmts / tokens.md
Last active April 21, 2024 18:00
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@pbabics
pbabics / gitlab-gc.sh
Created November 11, 2016 13:13
Manual garbage collector for gitlab registry, it removes old revisions that are not referenced by any tag
#!/bin/bash
BASE_PATH=/var/opt/gitlab/gitlab-rails/shared/registry/docker/registry/v2/repositories
DRY_RUN=0
KEEP_LAST_IMAGES=10
RUN_GARBAGE_COLLECTOR=0
GITLAB_CTL_COMMAND=`which gitlab-ctl`
@eirnym
eirnym / metadata.py
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
ruario / README.md
Last active January 7, 2023 20:52
Installs (or updates) PPAPI Flash, so that it can be used by Chromium-based browsers

Usage

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

sudo add-apt-repository "deb http://archive.canonical.com/ubuntu `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 "latest-pepper-flash.sh".

@nealtodd
nealtodd / settings_test_snippet.py
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
django.setup()
ma = MigrationExecutor(connections[db]).loader.migrated_apps
return dict(zip(ma, ['{a}.notmigrations'.format(a=a) for a in ma]))