Skip to content

Instantly share code, notes, and snippets.

krackers / Makefile
Created September 19, 2023 04:51 — forked from kazupon/Makefile
semaphore multi process sample for Mac OSX
View Makefile
all: multi-process-counter
build: multi-process-counter
${CC} -std=c99 -o multi-process-counter multi-process-counter.c
#${CC} -std=c99 -arch x86_64 -o multi-process-counter multi-process-counter.c
krackers / mach_semaphore.c
Created September 19, 2023 04:51 — forked from kazupon/mach_semaphore.c
Using mach_semaphore on Mac OS X to mutually signaling between two threads. This could be extended to work with different processes.
View mach_semaphore.c
// Created by Yogesh Swami on 2/24/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
// clang -Wall -Wextra -Wall -o mach_semaphore mach_semaphore.c
// using mach semaphore for mutually signalling between two threads.
krackers / gist:2b85ef0d6fab32ab0aaac1bd3aa38907
Created September 3, 2023 09:10 — forked from andrewsardone/gist:3751168
How does UIKit get pixels onto the screen?
View gist:2b85ef0d6fab32ab0aaac1bd3aa38907
krackers /
Created August 25, 2023 09:22 — forked from hzhu212/
Python iterator with chain-call like Java stream

Python Stream object act like Java Stream, features include lazy calculating, slicing, chain-call etc.

import functools
import itertools

class Stream(object):
krackers /
Created August 23, 2023 22:10 — forked from fzwo/
Download and view old Apple developer documentation

How to download and view legacy documentation from Apple (no need to sign in to your dev account)

  1. Download the docset index XML.
  2. Find the docset you want (there are some with URL; ignore them - you will find them again further down the file with a working URL).
  3. Download the dmg. It's probably around a gigabyte or so.
  4. "Install" the .pkg file somewhere on your disk. If you don't trust the installer, do it manually:
    1. Find the largest file, named Payload, and extract it using The Unarchiver.
    2. This creates a new, even larger file, probably named Payload-1.
    3. Extract Payload-1 using The Unarchiver.
  5. After many minutes of extracting, we have our .docset file.
krackers / swizzler.h
Last active August 20, 2023 00:19 — forked from saagarjha/swizzler.h
Type-safe, RAII swizzler for Objective-C++
View swizzler.h
#import <Foundation/Foundation.h>
#import <atomic>
#import <memory>
#import <objc/runtime.h>
#include <objc/message.h>
#import <stdexcept>
#import <iostream>
krackers /
Created June 12, 2023 02:57 — forked from Mnkai/
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)

TDP and turbo parameter modification with MSR on non-overclockable CPU


  • MSR modification may void your CPU's (or system board's) warranty. Proceed with care. I'm not responsible for any destruction caused by this article.
  • MSR address (greatly) differs from CPU to CPU. Check your own CPU's MSR address using Intel's documentation.
  • Only tested on Intel i7-8550U (Kaby Lake R).
  • This article is translation of this article. If you can understand Korean, I recommend reading that article, not this.


View Wayback Machine SPN2 API Docs
Save Page Now 2 Public API Docs Draft
Vangelis Banos, updated: 2022-04-05
Capture a web page as it appears now for use as a trusted citation in the future. Changelog:
Glossary 1
Basic API Reference 1
Capture request 1
krackers / macOS
Created May 7, 2023 05:22 — forked from kconner/macOS
macOS Internals
View macOS
krackers /
Created May 6, 2023 23:55 — forked from stevenojo/
Objective-C Debounce Example Using GCD Dispatch Sources / Timer

##Debouncing using GCD on iOS

The idea of "Debouncing" is to limit the rate a function or task can execute by waiting a certain amount of time before executing it. In the example below, if a user rapidly enters input, it will only execute once, 1 second after all that input. This is the implementation of a sample class showing how to do so, while using Grand Central Dispatch to create a timer. The timer fires on a global queue in this example - but you can change the queue to any queue where you want the timer to execute, regardless of where you set it up.

#import <Foundation/Foundation.h>

@interface DebounceExample : NSObject