Skip to content

Instantly share code, notes, and snippets.

View michael-nischt's full-sized avatar

Michael Nischt michael-nischt

View GitHub Profile
@ManuelTS
ManuelTS / UninstallUnity.sh
Last active January 16, 2018 05:01
Uninstalls the Unity Editor on Ubuntu
#!/usr/bin/env bash
# Uninstalls the Unity Editor on Ubuntu.
#
# Tested for Unity 2017.30f1 downloaded from https://beta.unity3d.com/download/3c89f8d277f5/public_download.html
# and Ubuntu 17.10, but it should work with other version too.
#
# Unity is expected to be installed in your home folder, otherwise
# change the first remove command to your installation path.
#
# Execute this program as root, e.g. "sudo sh UninstallUnity.sh"
@paniq
paniq / twistpool.c
Last active August 28, 2019 22:17
Twisting Pool Allocator
/*
Twisting Pool Allocator
=======================
written by Leonard Ritter (leonard.ritter@duangle.com)
This file is in the public domain
I don't know if I was the first one to stumble upon this technique, so
I can't guarantee there's no patent on it, but let's hope there's not,
@rygorous
rygorous / bc4u_interp_to_float.py
Last active September 27, 2021 09:40
BC4 interpolator results to float conversion attempt
# Computes the 32-bit IEEE float bit pattern for x/16320 (where x is given as an integer),
# with rounding slightly off from proper RN, matching observed behavior of AMD BC4_UNORM
# decoder HW
def hw_14bit_to_floatu_v2(x, trace=False):
if x <= 0:
return 0
elif x >= 255 * 64:
return 0x3f800000
else:
# 16320 = 255*64
@andrewkroh
andrewkroh / install-go.ps1
Last active November 24, 2022 13:13
Install Golang using Powershell
# Installs golang on Windows.
#
# # Run script:
# .\install-go.ps1 -version 1.5.3
#
# # Download and run script:
# $env:GOVERSION = '1.5.3'
# iex ((new-object net.webclient).DownloadString('SCRIPT_URL_HERE'))
Param(
[String]$version,
@martinkunev
martinkunev / heap.c
Created November 14, 2011 22:52
Binary heap (C implementation)
// WARNING: Requires C99 compatible compiler
#include <unistd.h>
#include <stdlib.h>
#include "heap.h"
#define CMP(a, b) ((a) >= (b))
static const unsigned int base_size = 4;
@MattRix
MattRix / Unity-BlenderToFBX.py
Last active January 8, 2023 12:51
Custom Unity-BlenderToFBX based on a version from blenderartists.org with some minor modifications
##########################################################
# Custom Blender -> Unity Pipeline
# http://www.mimimi-productions.com, 2014
# Version: 1.9.M2
# Only for Blender 2.58 and newer
#
# Thanks to kastoria, jonim8or and Freezy for their support!
# Special thanks to Sebastian hagish Dorda for implementing the sort methods.
# http://www.blenderartists.org
##########################################################
@paniq
paniq / minmaxabssign.txt
Last active January 30, 2023 14:31
useful min/max/abs/sign identities
max(-x,-y) = -min(x,y)
min(-x,-y) = -max(x,y)
abs(x) = abs(-x)
abs(x) = max(x,-x) = -min(x,-x)
abs(x*a) = if (a >= 0) abs(x)*a
(a < 0) -abs(x)*a
// basically any commutative operation
min(x,y) + max(x,y) = x + y
@StefanoBelli
StefanoBelli / disable_gpe6F.service
Last active June 24, 2023 09:08
Temporary fix for ACPI (GPE iinterrupts) failure , disable GPE6f interrupts, probably motherboard faulty ACPI implementation (reflash/update BIOS) [[!!You should take action!!]]. Install this in /usr/lib/systemd/system and run systemctl enable disable_gpe6F
[Unit]
Description=Disable GPE6F interrupts
[Service]
Type=oneshot
ExecStart=/bin/bash -c "echo disable > /sys/firmware/acpi/interrupts/gpe6F"
[Install]
WantedBy=multi-user.target
@flibitijibibo
flibitijibibo / flibitPackaging.md
Created June 17, 2016 16:00
Hope you like reading ldd output!

A week ago I was CC'd in on a thread about Linux packaging, and how to avoid doing it the wrong way (i.e. RPM, Deb, etc.). I've always used MojoSetup and I've never forced distributions to do any additional work, but this is still a new concept to a lot of people. Additionally, Amos suggested that I expand on Itch's FNA appendix, so here's a guide on how I package my games.

This is a bit of an expansion on my MAGFest 2016 presentation, which you can find here:

http://www.flibitijibibo.com/magfest2016/

https://www.youtube.com/watch?v=B83CWUh0Log

I would recommend looking at that first! After that, read on...

//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//