Skip to content

Instantly share code, notes, and snippets.

View PierceLBrooks's full-sized avatar
🇵🇸

Pierce Brooks PierceLBrooks

🇵🇸
View GitHub Profile
@sxiii
sxiii / readme.md
Created March 4, 2021 19:40
How to launch games via Proton from CLI (useful for debug)

How to launch games via Proton from CLI (useful for debug)

In just 2 steps

First. Run this:

export STEAM_COMPAT_DATA_PATH=~/.local/share/Steam/steamapps/compatdata

Second. Now in the same terminal, run your game (this example: Raft)

~/.local/share/Steam/steamapps/common/Proton\ 5.13/proton run ~/.local/share/Steam/steamapps/common/Raft/Raft.exe

@dov
dov / create_triangle_gltf.cpp
Created February 25, 2021 21:03
Example of how to build a gltf file from scratch with tiny_gltf.h
// An example of how to generate a gltf file from scratch. This example
// was translated from the pygltlib documentation in the pypi project page,
// which in turn is based on the Khronos Sample Models at:
//
// https://github.com/KhronosGroup/glTF-Sample-Models
//
// This example is released under the MIT license.
//
// 2021-02-25 Thu
// Dov Grobgeld <dov.grobgeld@gmail.com>
@Nearcyan
Nearcyan / stylegan2_psi_translation_video.md
Last active April 13, 2026 01:44
create stylegan2 psi-translation video

Make psi-translation videos

Short file on how to make psi-transition videos with StyleGan2. This assumes you are already able to run StyleGan2.

example

Edit generator

Edit generate_images() in run_generator.py to iterate through psi values instead of seeds.

@Pikachuxxxx
Pikachuxxxx / Sphere.cpp
Last active July 24, 2024 19:12
A script to generate an UV Sphere vertices, normals, texture coordinates and Indices.
std::vector<glm::vec3> sphereVertices;
std::vector<glm::vec3> sphereNormals;
std::vector<glm::vec2> sphereUVs;
std::vector<unsigned int> sphereIndices;
void GenerateSphereSmooth(int radius, int latitudes, int longitudes)
{
if(longitudes < 3)
longitudes = 3;
if(latitudes < 2)
@valinet
valinet / toast1.c
Created December 21, 2020 19:22
Send a toast notification in Windows 10 using plain C
// Send toast notifications in Windows 10, using Windows Runtime,
// without any language projection, in PLAIN C
// Copyright (c) 2021 Valentin - Gabriel Radu
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this softwareand associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
// copies of the Software, and to permit persons to whom the Software is
@TellowKrinkle
TellowKrinkle / HiguMeiExtractor.py
Created November 28, 2020 04:26
Extractor for unity3d files from Higurashi Mei
import unitypack
import unitypack.utils
import collections
import sys
import os
from unitypack.engine.texture import TextureFormat
from PIL import ImageOps
ASTC_MAP = {
TextureFormat.ASTC_RGB_4x4: (0x93B0, 0x1907),
@Te-k
Te-k / pdf_metadata.md
Created November 26, 2020 10:31
How to remove metadata from PDFs

Many tools do not fully remove metadata, but just remove the link with in the metadata table. The data are thus still available in the PDF file itself.

While a lot of people rely on Exiftool to remove metadata, it actually does the same in PDFs. If you remove metadata with exiftool -all= some.pdf, you can always restore the data with exiftool -pdf-update:all= some.pdf.

There are several options to remove PDF metadata safely:

Option 1 : Exiftool with qpdf

  • Remove metadata with exiftool : exiftool -all= some.pdf
  • Then remove ununsed objects with qpdf : qpdf --linearize some.pdf - &gt; some.cleaned.pdf
@rokups
rokups / CMakeLists.txt
Last active June 18, 2026 08:40
Dear ImGui CMake build script.
#
# CMake build system for Dear ImGui
# =================================
#
# Build instructions:
# 1. Install latest CMake
# * Windows: https://cmake.org/download/ (Tick checkbox to place cmake in system PATH)
# * Linux: from your favorite package manager
# * MacOS: brew install cmake
# 2. Open command prompt in directory containing "imgui" and "imgui_dev" folders
@CGLion
CGLion / blender_get_vert_uvs.py
Last active October 6, 2025 03:28
Python for Blender - Read mesh UVs
import bpy
# access mesh data:
obj = bpy.context.active_object
mesh_data = obj.data
mesh_loops = mesh_data.loops
uv_index = 0
# iterate teh mesh loops:
for lp in mesh_loops:
# access uv loop:
uv_loop = mesh_data.uv_layers[uv_index].data[lp.index]
@zhuowei
zhuowei / WDBSetWebSecurityEnabled.m
Created September 1, 2020 04:47
Disable same-origin policy on iOS WKWebView with private API.
// Allows disabling Same-Origin Policy on iOS WKWebView.
// Tested on iOS 12.4.
// Uses private API; obviously can't be used on app store.
@import WebKit;
@import ObjectiveC;
void WKPreferencesSetWebSecurityEnabled(id, bool);
@interface WDBFakeWebKitPointer: NSObject