Skip to content

Instantly share code, notes, and snippets.

View Jamim's full-sized avatar

Aliaksei Urbanski Jamim

View GitHub Profile
@ForgottenUmbrella
ForgottenUmbrella / sway-transparency.patch
Created June 13, 2022 10:50
Revised sway patch to render transparent fullscreen containers
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 68f095c0..cc884b76 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -287,51 +287,26 @@ static void output_for_each_surface(struct sway_output *output,
};
struct sway_workspace *workspace = output_get_active_workspace(output);
- struct sway_container *fullscreen_con = root->fullscreen_global;
- if (!fullscreen_con) {
@Anexen
Anexen / Dockerfile
Last active January 30, 2025 17:49
production-ready dockerfile for python projects
# syntax = docker/dockerfile:experimental
ARG PYTHON_VERSION=3.7.6
ARG APP_ENV=prod
# ---------------------------------------------------------------
FROM python:${PYTHON_VERSION}-stretch AS base-builder
ENV VIRTUAL_ENV=/opt/venv
RUN python -m venv ${VIRTUAL_ENV}
@cartolari
cartolari / start-webstorm.sh
Last active May 22, 2020 21:15
Starts WebStorm in a TigerVNC session
#!/bin/bash
# Requirements
# - TigerVNC (Client and Server)
# - OpenBox
# - WebStorm
export DISPLAY=:10 # Change if display :10 is already in use
Xvnc -SecurityTypes=None +extension RANDR +extension GLX +extension COMPOSITE -SetPrimary=0 -SendPrimary=0 -depth 24 "$DISPLAY" &
@davidhariri
davidhariri / jwt-apple-signin.py
Created October 12, 2019 18:14
Code required to verify Sign in with app-made Apple JWT tokens server-side in Python
import jwt
from jwt.algorithms import RSAAlgorithm
import requests
from time import time
import json
import os
APPLE_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys"
APPLE_PUBLIC_KEY = None
@altaurog
altaurog / docker_descendants.py
Last active August 11, 2024 09:08
Python3 script to find descendants of one or more docker images
#!/usr/bin/python3
#
# usage: python3 docker_descendants.py <image_id> ...
import sys
from subprocess import check_output
def main(images):
image_ids = set(images)
@ObserverHerb
ObserverHerb / virtualbox-modules-5.1.28-udp.patch
Created October 21, 2017 03:10
virtualbox-modules-5.1.28 SKB_GSO_UDP patch for Gentoo
diff --git a/work/vboxnetflt/linux/VBoxNetFlt-linux.c b/work/vboxnetflt/linux/VBoxNetFlt-linux.c
index f824654..b61d82c 100644
--- work/vboxnetflt/linux/VBoxNetFlt-linux.c
+++ work/vboxnetflt/linux/VBoxNetFlt-linux.c
@@ -126,6 +126,10 @@ typedef struct VBOXNETFLTNOTIFIER *PVBOXNETFLTNOTIFIER;
# endif
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+#define SKB_GSO_UDP 0
@justincbagley
justincbagley / How_to_Convert_Markdown_to_PDF.md
Last active March 27, 2025 03:38
How To Convert Markdown to PDF

How to convert markdown to PDF:

This post reviews several methods for converting a Markdown (.md) formatted file to PDF, from UNIX or Linux machines.

Using Pandoc:

$ pandoc How_I_got_svg-resizer_working_on_Mac_OSX.md -s -o test1.pdf
@biwin
biwin / community_to_shell.py
Last active January 12, 2024 10:53
Change PyCharm Community Python Console to PyCharm Professional Django Console (Django Shell)
# Change the run script on `settings> Build Execution and Deployment > Console > Python Console` to
# hoping you have your settings at project/project/settings.py (if not, change accordingly;)
import os,sys,django;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
os.environ['DJANGO_SETTINGS_MODULE'] = WORKING_DIR_AND_PYTHON_PATHS.split('/')[-1]+'.settings'
print('Python {0} on {1} using {2} as settings'.format(sys.version, sys.platform, os.environ['DJANGO_SETTINGS_MODULE']))
django.setup()
@vxgmichel
vxgmichel / udpproxy.py
Created February 2, 2017 10:05
UDP proxy server using asyncio
"""UDP proxy server."""
import asyncio
class ProxyDatagramProtocol(asyncio.DatagramProtocol):
def __init__(self, remote_address):
self.remote_address = remote_address
self.remotes = {}
@gkbrk
gkbrk / lolcat.asm
Created July 27, 2016 13:26
Lolcat clone in x64 assembly
section .data
char_buffer db 0
section .text
global _start
_start:
mov r12, 0
.loop:
call read_char