Skip to content

Instantly share code, notes, and snippets.

View Feliix42's full-sized avatar
🔬
Searching optimizations

Felix Suchert Feliix42

🔬
Searching optimizations
View GitHub Profile
@ibireme
ibireme / kpc_demo.c
Last active February 17, 2026 10:35
A demo shows how to read Intel or Apple M1 CPU performance counter in macOS.
// =============================================================================
// XNU kperf/kpc demo
// Available for 64-bit Intel/Apple Silicon, macOS/iOS, with root privileges
//
//
// Demo 1 (profile a function in current thread):
// 1. Open directory '/usr/share/kpep/', find your CPU PMC database.
// M1 (Pro/Max/Ultra): /usr/share/kpep/a14.plist
// M2 (Pro/Max): /usr/share/kpep/a15.plist
// M3: /usr/share/kpep/as1.plist
@sebschrader
sebschrader / config.py.sample
Last active October 5, 2016 14:18
GitHub Release Hook to run Jekyll
# SECRET must be a bytes object
SECRET = b"correcthorsebatterystaple"
TARGET_DIR = "/var/www/htdocs/my-site"
REPO_DIR = "/var/lib/my-repo.git"
@mamiu
mamiu / install_habitrpg.md
Last active March 4, 2017 22:43
Install HabitRPG on Uberspace.

##This is a guide to install HabitRPG on an Uberspace.

###Installation

First you have to create a folder which is accessable from the web (e.g. habitrpg.yourdomain.com) and then move to it. In this folder execute

git clone https://github.com/HabitRPG/habitrpg.git .

After that, you have to download some dependencies with:

@chrisdavies
chrisdavies / gist:9d9c0aff6229ef1d3eef
Created October 28, 2014 14:08
Rust - lifetime constraint and generic constraint on a struct
use std::io::Writer;
// This specifies lifetime constraint of 'a
// Type W must implement the Writer trait
// Type W has the lifetime 'a (the same as the related struct instance)
pub struct Foo<'a, W: 'a + Writer> {
writer: &'a mut W
}