Skip to content

Instantly share code, notes, and snippets.

View EAirPeter's full-sized avatar

EAirPeter EAirPeter

View GitHub Profile
@MaskRay
MaskRay / lto.md
Last active March 20, 2024 14:27

Concept

A LTO unit is the subset of the linkage unit that is linked together using link-time optimization.

Add module

LTO::add(...) {
}
@jechter
jechter / Program.cs
Created May 12, 2020 09:48
Standalone C# GC frame time stress test
using System;
using System.Diagnostics;
using System.Runtime;
/*
This little program is a stress test for GC performance we care about in Unity.
It will basically create a heap of managed memory with references between allocations
(just some linked list), and then randomly replace some memory every loop iteration - to
simulate a game which dirties some memory every frame. This allocation pattern may not be
@abel0b
abel0b / install-linux-perf-on-wsl2.sh
Last active April 29, 2024 10:29
Install perf on WSL 2
apt install flex bison
git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1
cd WSL2-Linux-Kernel/tools/perf
make -j8
sudo cp perf /usr/local/bin
@intinig
intinig / .clang-format
Last active January 13, 2024 11:56
.clang-format for UE4
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
@xenithorb
xenithorb / kmod-signer.sh
Last active November 16, 2021 07:49
Akmod kernel module auto-signer for kernel upgrades on Fedora
#!/bin/bash
#
# /etc/kernel/postinst.d script to sign akmods kmods after kernel upgrade
#
# Author: Michael Goodwin Date: 2016-09-21
# 1. Copy this script to /etc/kernel/postinst.d/ and `chmod +x` it
#
# 2. Create signing keys (store these somewhere useful and safe):
# $ mkdir -p /etc/pki/tls/private/mok
@typcn
typcn / live_number.py
Created August 25, 2015 12:29 — forked from cnbeining/live_number.py
A simple script to get lots of viewers of Bilibili Live - PLUS
#!/usr/bin/env python
#coding:utf-8
# Author: Beining --<cnbeining#gmail.com>
# Author: TYPCN --<typcncom#gmail.com> ( Performance improve and fix )
# Purpose: A simple script to get lots of viewers of Bilibili Live
# Created: 08/11/2015
# Error report: http://www.cnbeining.com/?p=952
# https://github.com/cnbeining somewhere within my gists
import sys
@spott
spott / infix_operator.cpp
Created June 7, 2012 17:24 — forked from dscharrer/infix_operator.cpp
The proper way to call std::swap
#include <type_traits>
namespace detail {
// No need to give up constexpr for std::forward
template <class T>
constexpr T && forward(typename std::remove_reference<T>::type & t) noexcept {
return static_cast<T &&>(t);
}