Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import multiprocessing
import random
import time
class Logger:
def __init__(self, num_lines, last_output_per_process, terminal_lock):
self.num_lines = num_lines
@qwerty12
qwerty12 / README.md
Last active April 16, 2024 16:12
pk.q12.defvidspeed - quick and dirty Kodi addon to set a default video speed
@adtac
adtac / Dockerfile
Last active April 13, 2024 22:33
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@bitmvr
bitmvr / parseable-curl-response-example.sh
Last active January 7, 2024 15:12
Create Parseable cURL Response with Bash and jq
#!/usr/bin/env bash
__http_request_example(){
curl \
--silent \
--location http://ip.jsontest.com \
--write-out "\n%{http_code}"
}
__response_formatter(){
@r0x0d
r0x0d / check.py
Last active December 20, 2023 19:41
CLEANUP_MODULES_ON_EXIT_REGEX = re.compile(r"(?i)CleanupModulesOnExit\s*=\s*(yes|true)")
def _is_modules_cleanup_enabled():
"""Verify firewalld modules cleanup config is enabled.
:returns: Whether or not the CleanupModulesOnExit is set to true in
firewalld config.
:rtype: bool
"""
# Return false if the config file does not exist. Either it means that
@evinjaff
evinjaff / addon.xml
Created October 27, 2023 09:23
Random Startup Movie Hack for Arctic Zephyr Kodi Skin
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.autoexec" name="Autoexec Service" version="1.0.0" provider-name="evinjaff">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
<extension point="xbmc.service" library="autoexec.py">
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Automatically run python code when Kodi starts.</summary>
<description lang="en_GB">The Autoexec Service will automatically be run on Kodi startup.</description>
@Tekunogosu
Tekunogosu / starfieldcustom.ini
Last active February 13, 2024 13:59
starfieldcustom.ini
[Display]
fDefault1stPersonFOV=90
fDefaultFOV=90
fDefaultWorldFOV=90
fFPWorldFOV=90
fTPWorldFOV=90
;bEnableRaytracing=1
;bUseSkyLighting=1
;set to 0 to disable
fMaxAnisotropy=2
@MiYanni
MiYanni / StarfieldMods.md
Last active February 8, 2024 19:25
StarfieldMods.md
@TangentFoxy
TangentFoxy / file_size_stats.lua
Last active January 14, 2024 02:52
Generate statistics on file sizes within a directory. (Lua, using LuaFilesystem.)
#!/usr/bin/env luajit
-- THIS IS BEING MAINTAINED AT https://github.com/TangentFoxy/.lua-files
-- GO THERE INSTEAD OF DOWNLOADING THIS FILE DIRECTLY.
-- Primarily written by ChatGPT using GPT-3.5, with corrections and modifications by me.
-- Do whatever the hell you want with it.
local lfs = require "lfs"
@KokoseiJ
KokoseiJ / snowflake.py
Last active December 20, 2023 19:38
Customizable and portable Snowflake generator
import os
import time
from math import floor
class SnowflakeGenerator:
def __init__(self, mid=None, time_start=1288834974657):
self.time_start = time_start
self.mid = mid if mid else os.getpid()