Skip to content

Instantly share code, notes, and snippets.

@Temetra
Temetra / SendFormIdToStoryEvent.psc
Created December 1, 2023 05:08
Fallout 4: Send FormId to story manager script event
; https://www.creationkit.com/fallout4/index.php?title=Operator_Reference#Comparison_Operators
int Function GetLow3Bytes(int i)
{Set the high 8 bits of i to zero, and return the low 24 bits intact.
Equivalent to "i & 0x00FFFFFF" in C, Java, etc.}
if i < 0
; Force i to be a positive number, by changing its high bit (bit 32) from 1 to 0.
i += 0x80000000
endIf
return i % 0x01000000
EndFunction
@Temetra
Temetra / winocr.py
Created November 26, 2023 09:23 — forked from dantmnf/winocr.py
WinRT OcrEngine from Python
import sys
import asyncio
import base64
import copy
import pprint
# pip3 install winrt
from winrt.windows.media.ocr import OcrEngine
from winrt.windows.globalization import Language
from winrt.windows.graphics.imaging import *
from winrt.windows.security.cryptography import CryptographicBuffer
@Temetra
Temetra / hide-steam-whats-new.txt
Created June 15, 2023 18:10
Prevent Steam's "What's New" from showing
Search for these 181 characters in Steam\steamui\chunk~2dcc5aaf7.js
return{bEventsLoaded:this.m_bEventsLoaded,bInitialLoadPending:this.m_bInitialLoadPending,eventsToShow:this.GetLibraryHomeBestEventsForUser(),takeoverEvents:this.GetTakeOverEvents()}
Replace with these 181 characters. There's a lot of spaces, they are required to avoid triggering Steam re-downloading the file.
return { bEventsLoaded: false, bInitialLoadPending: false, eventsToShow: [], takeoverEvents: [] }
@Temetra
Temetra / remove-twitter-login-prompts.user.js
Last active December 23, 2022 20:49
Greasemonkey script to remove Twitter login prompts
// ==UserScript==
// @name Remove Twitter Login Prompts
// @namespace Violentmonkey Scripts
// @match https://twitter.com/*
// @grant none
// @version 1.2
// @author Temetra
// @description 20/12/2022, 09:25:19
// ==/UserScript==
@Temetra
Temetra / convert-named-colors.py
Created December 7, 2022 22:09
Convert a list of CSS named colors into a Python class of RGBA colors
print("class Color:")
with open("named-colors.txt", encoding="utf8") as text:
for line in [line.rstrip("\n") for line in text]:
# Split line into name and hex color
name, color = line.split()
# Convert hex color into RGB
color = tuple(int(color.lstrip("#")[i:i+2], 16) for i in (0, 2, 4))
@Temetra
Temetra / generate_report.py
Created August 5, 2020 19:31
Replacement report generation (XML format) for Tuning Error Notifier by SCUMBUMBO (Sims 4 mod)
# Generates the XML report in a temporary file. This is called from the dialog_callback
# or the notification button's cheat command. A callback is registered to be called at Python
# exit time to remove the temporary file.
def generate_report(self):
(tmp_fd, filename) = tempfile.mkstemp(suffix='.xml', text=True)
with os.fdopen(tmp_fd, 'w') as fp:
fp.write('<?xml version="1.0"?>')
fp.write('\n<report on="{}">'.format(datetime.datetime.now().strftime('%c')))
for name in self._log_entries:
fp.write('\n\t<source name="{}">'.format(name))
@Temetra
Temetra / youtube_m3u.ipynb
Created June 9, 2017 19:01
Convert YouTube channel videos to M3U playlist
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.