Skip to content

Instantly share code, notes, and snippets.

View vyach-vasiliev's full-sized avatar

ฬะทçะรโลนร vyach-vasiliev

  • Milky Way galaxy, planet Earth
View GitHub Profile
@vyach-vasiliev
vyach-vasiliev / Install_Ignore_From_Dropbox_Context_Menu.reg
Last active May 1, 2024 21:45
Ignore from Dropbox by context menu in Windows OS [updated 2024]
Windows Registry Editor Version 5.00
;= Setup ignore file/folder menu.
;= Context menu to folders:
[HKEY_CLASSES_ROOT\Directory\shell\Dropbox F Ignore]
"AppliesTo"="System.ItemPathDisplay:\"Dropbox\""
"Icon"="C:\\Program Files (x86)\\Dropbox\\Client\\Dropbox.exe,12"
@="Ignore from Dropbox"
[HKEY_CLASSES_ROOT\Directory\shell\Dropbox F Ignore\command]
@vyach-vasiliev
vyach-vasiliev / pg_schema_size.sql
Created August 4, 2023 16:29 — forked from AndreyStekov/pg_schema_size.sql
Get schema size (postgres).
SELECT pg_size_pretty(sum(pg_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)))::bigint) FROM pg_tables
WHERE schemaname = 'yourschema'
@vyach-vasiliev
vyach-vasiliev / github_clone_using_token.sh
Last active July 25, 2023 14:15 — forked from magickatt/github_clone_using_token.sh
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=user
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=owner/repo-path
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
# or
git clone ${GITHUB_TOKEN}@github.com/{GITHUB_REPOSITORY}.git
@vyach-vasiliev
vyach-vasiliev / latest_version
Last active June 25, 2023 07:29
MemShow new version
1.0.0
@vyach-vasiliev
vyach-vasiliev / ReadMe.md
Last active April 7, 2023 17:26
X11 Desktop Environment under WSL (connect by RDP)

RUN X11 Desktop Environment under WSL (connect by RDP)

Instruciton for WSL dist: Ubuntu 20.04 LTS

Settings

install packages

sudo apt update && sudo apt -y upgrade
sudo apt-get install -y xfce4 xrdp

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@vyach-vasiliev
vyach-vasiliev / delete_cortana.md
Created March 13, 2023 17:24
Delete Cortana from Windows 10 [FOREVER]

A quick way to remove intrusive Cortana from your OS by PoweShell (under admin rights)

Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage

Hooray!

@vyach-vasiliev
vyach-vasiliev / check.sh
Created February 16, 2023 12:06
Check Django version for packages
#!/bin/sh
filename="check-"$(date '+%Y%m%d')".txt"
> "$filename"
while IFS= read -r line || [ -n "$line" ]; do
res=$(bash -c "sh runpython.sh -m johnnydep --output-format pinned $line" | grep -v "run python with params" | grep Django)
echo -n "$res, " >> "$filename"
echo "$line" >> "$filename"
done < requirements.local.txt
@vyach-vasiliev
vyach-vasiliev / ReadMe.md
Last active April 22, 2023 00:44
One element CSS Snow by Keith Clark
@vyach-vasiliev
vyach-vasiliev / gist:24f6d68bd5d93d39e95661b818383b9e
Created December 27, 2022 11:29 — forked from linuxfood/gist:1474361
Django ModelForm custom fields in ModelAdmin
from django.contrib import admin
from django import forms
class MyModelAdmin(admin.ModelAdmin):
# ...
def get_form(self, request, obj=None, **kwargs):
form_factory = super(MyModelAdmin, self).get_form(request, obj, **kwargs)
form_factory.base_fields['my_custom_field'] = forms.CharField(widget=forms.Textarea(), required=True)
# ...
def save_model(self, request, obj, form, change):