Skip to content

Instantly share code, notes, and snippets.

View piscisaureus's full-sized avatar
🦕

Bert Belder piscisaureus

🦕
View GitHub Profile
// Capture - remove by function pointer and data
void AddGCPrologueCallback(GCCallbackWithData callback, void* data = nullptr, GCType gc_type_filter = kGCTypeAll);
void RemoveGCPrologueCallback(GCCallbackWithData, void* data = nullptr);
void AddGCEpilogueCallback(GCCallbackWithData callback, void* data = nullptr, GCType gc_type_filter = kGCTypeAll);
void RemoveGCEpilogueCallback(GCCallbackWithData callback, void* data = nullptr);
void AddMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void* data = nullptr);
void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void* data = nullptr) = 0;
@danieleggert
danieleggert / GPG and git on macOS.md
Last active October 27, 2024 11:07
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
#!/bin/bash
while [[ $# -gt 1 ]]
do
case "$1" in
-f | --file)
file="$2"
shift 2
;;
-h | --hostname)
@bnoordhuis
bnoordhuis / pthread_chdir.c
Created December 6, 2012 02:25
OS X undocumented __pthread_chdir() and __pthread_fchdir() syscalls
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <fcntl.h>
#ifndef SYS___pthread_chdir
# define SYS___pthread_chdir 348
#endif
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@piscisaureus
piscisaureus / pub.key
Created June 26, 2012 01:38
PGP public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (MingW32)
mQENBE/pEkoBCACtr5WCAklniyuawn8jLoU7iE5RJ3KjgRpp9Jp7oYczCXgjK3ta
SQwACbjYHN6mO/mW7povj6bpYjwQbRriIGOOQbM5stsi1iSOgl7M7LRQWEkOCFuI
pjnL/LEgrcO2fVskINf86MyXgBTfTW3szDp+WDDGHoXFis17B17wRkTNJMm6sJ+L
INLTsjLo++6aHjHmCYmY5jmP2kMfI3kiYkGMG6r3RaOEqq9TJc1cGFqNEdg46Gio
4NUkeiOE1lPoe1h0x0PIXn2AJmJt0bfuqVFAD4/5i9cfg990Ly3MnnydKV3ALuLQ
n2rwyY4DtnkDY7LONt1qDW/NzjAZz3DW7lTxABEBAAG0IkJlcnQgQmVsZGVyIDxi
ZXJ0YmVsZGVyQGdtYWlsLmNvbT6JATUEEwECAB8FAk/pEkoCGwMGCwkIBwMCBBUC
Kernel Flags:
PROC_THREAD : Process and Thread create/delete
LOADER : Kernel and user mode Image Load/Unload events
PROFILE : CPU Sample profile
CSWITCH : Context Switch
COMPACT_CSWITCH: Compact Context Switch
DISPATCHER : CPU Scheduler
DPC : DPC Events
INTERRUPT : Interrupt events
SYSCALL : System calls