Skip to content

Instantly share code, notes, and snippets.

View webknjaz's full-sized avatar
🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine

🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) webknjaz

🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine
View GitHub Profile
@tiesmaster
tiesmaster / disable-branch-protection.sh
Last active September 5, 2023 08:06
Enable/disable branch protection on GitHub through their API
#!/bin/bash
OAUTH2_TOKEN=<fill in your own OAUTH2 token>
OWNER=tiesmaster
REPO=Coolkit.Converters # retrieve this with: basename $(git config --get remote.origin.url) .git
curl https://api.github.com/repos/${OWNER}/${REPO}/branches/master \
-H "Authorization: token $OAUTH2_TOKEN" \
-H "Accept: application/vnd.github.loki-preview+json" \
@simonw
simonw / how-to.md
Last active April 16, 2025 15:21
How to create a tarball of a git repository using "git archive"
@staaldraad
staaldraad / x11.py
Last active August 28, 2022 05:09
Python script to do keystrokes via X11 abstract socket. Useful for silly docker breakout.
#!/usr/bin/python
"""
Python script to connect to an abstract unix socket created by X11 and send arbitrary key-strokes.
Created by: [email protected]
Credits to: https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/unix/x11/x11_keyboard_exec.rb
Borrowed heavily from the original metasploit module. Thanks!
"""
from socket import *
import subprocess
@hexchain
hexchain / 51-noto-color-emoji.conf.xml
Last active July 7, 2020 23:42
Emoji on Linux desktop. Use with aur/cairo-coloredemoji.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/conf.avail/51-noto-color-emoji.conf -->
<fontconfig>
<selectfont>
<acceptfont>
<pattern>
<patelt name="family"><string>Noto Color Emoji</string></patelt>
</pattern>
</acceptfont>
@drmalex07
drmalex07 / README-python-service-on-systemd-activated-socket.md
Last active January 20, 2025 10:48
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at /opt/foo/serve.py.

@parmentf
parmentf / GitCommitEmoji.md
Last active May 5, 2025 18:02
Git Commit message Emoji
@davidhalter
davidhalter / pep484transform.py
Created December 18, 2015 17:57
Jedi generates Pep 484 type annotations.
"""
Transforms a normal Python file to pep484 annotations using Jedi.
Usage:
pep484transform.py <file> [-d]
Options:
-d, --debug Show Jedi's debug output.
"""
from os.path import abspath
@trevnorris
trevnorris / proper_code_column_length.txt
Last active August 9, 2016 20:38
Quick notes on why constraining cpl is an advantage when writing source
While the standard 80 character limit for source code can be traced back to the
IBM punch card[1] it can still be seen as a good upper bound for how long lines
of text should be on modern high definition displays.
First thing we must acknowledge is that source code is not read in the
traditional sense. Instead developers scan the source using non-linear eye
movements[2] or stay fixated in a small area of code while working out the
logical details of code being written. The fixation on a single location, even
for more than a few seconds, leads to a loss of visual accuity. Which occurs
when the eyes do not perform frequent saccadic eye movements.[3] Further
@colinvh
colinvh / pep-440-semver.md
Last active February 29, 2024 13:25
440 Semantic

PEP-440-Compatible Semantic Versioning

This document attempts to refine Python's PEP 440 to include the principles of Semantic Versioning.

Specification

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 5, 2025 01:35
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites