Skip to content

Instantly share code, notes, and snippets.

@thendrix
thendrix / TwitterPurge.py
Created January 9, 2021 12:31
TwitterPurge can remove all your tweets by using the archive function to access tweets not accessible via timeline API
#!/usr/bin/env python3
# TwitterPurge is a simplified python script to perform operations on twitter archives.
# I wrote this in a single day while reading an API doc for the first time.
#
# Any tips you can spare will go to fund alt social media and tools
# BTC: bc1qe0el876trjjuuu3zr729n3w3zp4t2k92smklkz
#
# Setup python
# ==========================================================
# Download and install python3 from https://www.python.org/downloads/
@thendrix
thendrix / Context.sublime-menu
Created March 21, 2020 02:32
Example perforce pop-up menu
[
{
"caption" : "Perforce",
"mnemonic" : "P",
"id": "Perforce",
"children": [
{
"caption" : "Visual Client",
"mnemonic" : "V",
"command" : "build",
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8a0283..dde9c43 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,4 +34,7 @@ target_sources(img2ktx PRIVATE
add_subdirectory(third_party)
# This line should be in third_party/CMakeLists.txt, but would require CMake 3.13 (see CMP0079 for details)
target_link_libraries(img2ktx PRIVATE Compressonator)
+if(${UNIX})
+ target_link_libraries(img2ktx PRIVATE pthread)
@thendrix
thendrix / gitrev-snippet.genie
Created February 3, 2020 06:20
Snippet for git version for build header
function KaBuild.VersionHeader(self)
return KaBuild.SourcePath(self, 'KaVersionBuildId.h')
end
-- ...
prebuildcommands {
'echo "#pragma once" > ' .. build:VersionHeader(),
'echo -n "#define ENGINE_BUILD_SRC 0x" >> ' .. build:VersionHeader(),
'git describe --always >> ' .. build:VersionHeader(),
@thendrix
thendrix / PyflakesSaveListener.py
Created January 9, 2019 07:20
Sublime Text 3 save listener to auto run pyflakes (lint) python files.
import re
import sublime
import sublime_plugin
import webbrowser
REG_RENAME = re.compile("\.(py)$")
EXT = re.compile(".*\.(py)$")
COMMAND = "pyflakes3 "
@thendrix
thendrix / ungrab.sh
Created December 31, 2018 17:36
Force ungrab mouse, useful for debugging games in Linux
# Install xdotool first
#sudo apt install xdotool
# Now you can force ungrab mouse
setxkbmap -option grab:break_actions
xdotool key XF86Ungrab
# @file This blender script finds all meshes without UVs and unwraps them.
# @author Terry Hendrix II github/thendrix
import bpy
# Unselect objects
for obj in bpy.context.selected_objects:
obj.select = False
# Find and process meshes without UVs
%YAML 1.2
# Reference: https://www.sublimetext.com/docs/3/syntax.html
# A systemd syntax highlight file for Sublime Text 3
# Fix comment support, fix heading, add boolean, add string, switch source type -- thendrix
---
name: Systemd
file_extensions: [service]
scope: source.service
contexts:
@thendrix
thendrix / fix-lfs-missing-objects.py
Last active May 6, 2017 11:43
Manually patch git lfs missing files for gitlab
# This was written to fix a long standing bug with gitlab LFS and some repos that were migrated over a year ago.
#
# @todo Pull in shell commands to 100% python if I ever need this again
#
# I make no fitness for any purpose claims
# I wrote this at 0300 after a concert... it worked for me at the time.
# Let me know if you fork this or have comments.
#
# Consider this MIT licensed
#
@thendrix
thendrix / tempnam-replace.c
Last active May 6, 2017 11:56
Use this to help purge the world of tempnam such as in FBX -- yes I tweeted this a while back
extern "C" {
// '-Wl,-wrap,tempnam'
char *__wrap_tempnam( const char *dir, const char *pfx )
{
// You'll have to rewrite this part for your filesystem layer.
static unsigned int i = 0;
const unsigned int len = 512;
char path[ len ];
KaFilePathToCachePathf( path, len, "%s%s-%d.tmp",