Skip to content

Instantly share code, notes, and snippets.

@emorozov
emorozov / dwm-6.4-xkb.diff
Last active July 2, 2023 09:27
Attempt to port xkb patch to dwm 6.4
View dwm-6.4-xkb.diff
From 99f8aa54e10c1c712d67c775151581ee88c40688 Mon Sep 17 00:00:00 2001
From: Eugene Morozov <jmv@emorozov.net>
Date: Wed, 30 Nov 2022 18:14:13 +0300
Subject: [PATCH] Adds xkb support.
---
config.def.h | 13 ++++--
dwm.c | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 126 insertions(+), 3 deletions(-)
@emorozov
emorozov / announce.py
Created October 24, 2022 05:45
Decode BitTorrent udp tracker announce
View announce.py
import sys
import struct
data = open(sys.argv[1], 'rb').read()
start = 0
client_id, action, transaction_id, infohash, peer_id, downloaded, left, uploaded, event, ip, key, num_want, port, extensions, s_len = (
struct.unpack('!QII20s20sQQQIIIiHHB', data)
)
View .pre-commit-config.yaml
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
@emorozov
emorozov / dell-g7.txt
Created December 17, 2021 10:33
Intel Core i7-8750H
View dell-g7.txt
Render Time:
Photon Time: 0 hours 0 minutes 1 seconds (1.160 seconds)
using 15 thread(s) with 1.347 CPU-seconds total
Radiosity Time: No radiosity
Trace Time: 0 hours 1 minutes 55 seconds (115.168 seconds)
using 12 thread(s) with 1363.761 CPU-seconds total
View fortune-mod-ru.diff
diff --git a/PKGBUILD b/PKGBUILD
index e0ab0c3..53c5eb8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,11 +7,11 @@ url="http://jack.kiev.ua/fortune-mod-ru/"
license=('GPL')
groups=()
depends=("fortune-mod")
-makedepends=()
+makedepends=(dos2unix)
@emorozov
emorozov / python-django-postgres-ci.yml
Created May 10, 2020 08:08 — forked from jefftriplett/python-django-postgres-ci.yml
This is a good starting point for getting Python, Django, Postgres running as a service, pytest, black, and pip caching rolling with GitHub Actions.
View python-django-postgres-ci.yml
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
View dev_middleware.py
"""
Originaly code was taken from: http://djangosnippets.org/snippets/290/
But I was made some improvements like:
- print URL from what queries was
- don't show queries from static URLs (MEDIA_URL and STATIC_URL, also for /favicon.ico).
- If DEBUG is False tell to django to not use this middleware
- Remove guessing of terminal width (This breaks the rendered SQL)
"""
try:
import cProfile as profile
@emorozov
emorozov / list_all_model_signals.py
Last active May 10, 2020 07:51 — forked from runekaagaard/list_all_model_signals.py
List all signals by model and signal type. Tested with Django 3.
View list_all_model_signals.py
# -*- coding: utf-8 -*-
# Based on https://gist.github.com/voldmar/1264102
# and https://gist.github.com/runekaagaard/2eecf0a8367959dc634b7866694daf2c
import gc
import inspect
import weakref
from collections import defaultdict
from django.apps import apps
@emorozov
emorozov / merged.fish
Created December 19, 2019 10:23
Find all merged branches in fish shell
View merged.fish
for branch in (git branch | awk '{ print $1 }')
if git log develop | grep $branch > /dev/null 2>&1
echo Merged $branch
end
end
View gist:8694826
# Last Modified: Mon Oct 26 13:29:13 2009
# REPOSITORY: http://apparmor.test.opensuse.org/backend/api draglor 53
# Additional profiling based on work by Андрей Калинин, LP: #226624
#include <tunables/global>
/usr/bin/skype flags=(complain) {
#include <abstractions/audio>
#include <abstractions/base>
#include <abstractions/fonts>
#include <abstractions/freedesktop.org>
#include <abstractions/kde>