Skip to content

Instantly share code, notes, and snippets.

#! python3
import shlex
import sys
import re
import io
header = open('openvr.h', newline='\n').read()
annoyingMacroPattern = re.compile(r'#define\s+(\w+).*VR_CLANG_ATTR.*')
@zodsoft
zodsoft / vtable.cpp
Created May 2, 2018 07:18 — forked from netguy204/vtable.cpp
Monkey patching a C++ class by modifying its VTABLE.
#include <stdio.h>
#include <stdint.h>
class A {
public:
virtual void doThing() {
printf("I'm an A\n");
}
};
@zodsoft
zodsoft / xd2md.cs
Created May 24, 2018 10:09 — forked from formix/xd2md.cs
Generates Markdown From VisualSturio XML documentation files
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace Formix.Utils
{
class Program
@zodsoft
zodsoft / AndroidManifest.xml
Created November 21, 2018 13:38 — forked from bjoernQ/AndroidManifest.xml
Creating a System Overlay (Always on Top over all Apps) in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.mobilej.overlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application android:label="SystemOverlay" >
<activity
@zodsoft
zodsoft / convert.py
Created May 31, 2021 13:59 — forked from michaelosthege/convert.py
Convert MP4/AVI clips to GIF with a single Python function
import imageio
import os, sys
class TargetFormat(object):
GIF = ".gif"
MP4 = ".mp4"
AVI = ".avi"
def convertFile(inputpath, targetFormat):
"""Reference: http://imageio.readthedocs.io/en/latest/examples.html#convert-a-movie"""
@zodsoft
zodsoft / PDF_extract_images.py
Created June 18, 2021 07:27 — forked from gstorer/PDF_extract_images.py
Extract images from a PDF file using Python, Pillow (PIL) and PyPDF2
# coding=utf-8
from __future__ import print_function
"""
The MIT License (MIT)
Copyright (c) 2018 Louis Abraham <louis.abraham@yahoo.fr>
Copyright ©2016 Ronan Paixão
Copyright (c) 2018 Gerald Storer
\x1B[34m\033[F\033[F
@zodsoft
zodsoft / renameillegalfiles.py
Created June 30, 2021 04:02 — forked from openp2pdesign/renameillegalfiles.py
Check and rename files with illegal chars
# -*- encoding: utf-8 -*-
#
# Author: Massimo Menichinelli
# Homepage: http://www.openp2pdesign.org
# License: MIT
#
import string
import os
@zodsoft
zodsoft / relsymlink.py
Created July 16, 2021 03:18 — forked from timpulver/relsymlink.py
[Python] Creates a relative symlink based on two directories. If only one directory is passed as an argument, the symlink will be created in the current working directory [Mac, Terminal, Symbolic Link, Absolute]
@zodsoft
zodsoft / DefaultKeyBinding.dict
Created May 15, 2022 14:35 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@zodsoft
zodsoft / can-packages-and-tools.md
Created May 25, 2022 14:03 — forked from jackm/can-packages-and-tools.md
Collection of CAN bus packages and tools

Collection of CAN bus packages and tools

This document assumes the use of Linux as the chosen development platform. Items in bold are highly recommended.

It is recommended to use SocketCAN when working with CAN bus on Linux. It is supported by the Linux kernel mainline and follows the Linux interface model, allowing you to use other network tools such as Wireshark. This also allows the creation of virtual CAN interfaces where no physical hardware is required to simulate or replay CAN messages.