Skip to content

Instantly share code, notes, and snippets.

@ifree
ifree / renderdoc_capture.py
Created June 7, 2024 16:38
Renderdoc in process frame capture
import ctypes
renderdoc_dll = ctypes.CDLL(r'renderdoc.[dll|so]')
# Calling convention
RENDERDOC_CC = ctypes.CFUNCTYPE
# Enums for capture options
class RENDERDOC_CaptureOption(ctypes.c_uint32):
eRENDERDOC_Option_AllowVSync = 0
@ifree
ifree / windows_live_captions_recorder.py
Last active March 14, 2024 16:07
Windows live captions recorder
from pywinauto.application import Application
import time
import math
import re
from collections import Counter
WORD = re.compile(r"\w+")
# cosine similarity https://stackoverflow.com/a/15174569/309846
def get_cosine(vec1, vec2):
@ifree
ifree / ProxySwitch.cs
Created February 23, 2024 11:05
PowerToys Run Proxy switch plugin
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using Microsoft.PowerToys.Settings.UI.Library;
using Wox.Plugin;
using Wox.Plugin.Logger;
@ifree
ifree / itt-coc.ts
Created December 17, 2023 15:51 — forked from VictorTaelin/itt-coc.ts
ITT-Flavored Calculus of Constructions Type Checker
// A nano dependent type-checker featuring inductive types via self encodings.
// All computation rules are justified by interaction combinator semantics,
// resulting in major simplifications and improvements over old Kind-Core.
// Specifically, computable annotations (ANNs) and their counterpart (ANN
// binders) and a new self encoding based on equality (rather than dependent
// motives) greatly reduce code size. A more complete file, including
// superpositions (for optimal unification) is available on the
// Interaction-Type-Theory repository.
// Credits also to Franchu and T6 for insights.
@ifree
ifree / zotero_tab_save_load.js
Last active March 12, 2024 15:47
Zotero tab save/load support
async function load_tabs_from_selected_item()
{
let opened_items = Zotero_Tabs._tabs.filter(t => !!t['data']).map(t=>t['data']['itemID'])
let selectedItems = ZoteroPane.getSelectedItems();
if (!selectedItems.length) {
throw new Error("Please select an item first.");
}
for(let item of selectedItems)
{
@ifree
ifree / mathjax.js
Last active January 11, 2022 01:54
MathJax for kinopio.club
// ==UserScript==
// @name MathJax for kinopio.club
// @namespace
// @version 0.1
// @description Enables MathJax on reddit for the TeXtheWorld delimiters [; ... ;].
// @match https://kinopio.club/*
// @copyright
// @namespace https://greasyfork.org/users/399493
// ==/UserScript==
if (window.MathJax === undefined) {
@ifree
ifree / GPUOptimizationForGameDev.md
Created June 22, 2020 15:38 — forked from silvesthu/GPUOptimizationForGameDev.md
GPU Optimization for GameDev
@ifree
ifree / premake5.lua
Created March 17, 2020 12:40
skeleton premake5 config
workspace "CPP_Playground"
configurations {"Debug", "Release", "DebugDLL", "ReleaseDLL"}
platforms {"x64"}
-- basedir (path.getabsolute(_PREMAKE_DIR .. "../"))
location "../build"
targetdir "../build/bin/%{cfg.longname}"
debugdir "../build/bin/%{cfg.longname}"
configuration {"Debug"}
@ifree
ifree / clipaste.cpp
Created March 1, 2020 11:45
paste clibpard image to web service
#include "pch.h"
#include "clipaste_api.h"
//#define WIN32_LEAN_AND_MEAN // GDI+ don't need this
// Windows Header Files
#include <windows.h>
#include <gdiplus.h>
@ifree
ifree / HTTPProxyServer.cs
Created December 13, 2019 09:01
Clipboard server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;