Skip to content

Instantly share code, notes, and snippets.

View changkun's full-sized avatar
🏠
https://changkun.de

Changkun Ou changkun

🏠
https://changkun.de
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active March 17, 2025 10:04
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@pervognsen
pervognsen / shift_dfa.md
Last active January 19, 2025 23:09
Shift-based DFAs

A traditional table-based DFA implementation looks like this:

uint8_t table[NUM_STATES][256]

uint8_t run(const uint8_t *start, const uint8_t *end, uint8_t state) {
    for (const uint8_t *s = start; s != end; s++)
        state = table[state][*s];
    return state;
}
@Dids
Dids / Compile_Go_for_Apple_Silicon_M1.md
Last active January 7, 2025 03:19
Compile Go for Apple Silicon (M1)

NOTICE: This guide is no longer relevant, as a lot has changed over time and Go supports Apple Silicon natively just fine now!

Compile Go for Apple Silicon (M1)

Follow these short instructions on how to compile Go for Apple Silicon (M1). From here on out, we may simply refer to it as the "ARM device".

This entire process should only take about 5-10 minutes, but please read through everything carefully, in order to avoid any potential issues along the way.

Note that at the time of writing this, Go was not yet officially available for Apple's ARM.

@mhamilt
mhamilt / Notes.md
Last active December 13, 2024 03:46
Metal Compute Shader Example in Swift and Objective C

Notes

Create a command line target in xcode either in Swift or Obj-C. add a metal file to the project and copy and paste the respective code into each file.

@mateuszwojt
mateuszwojt / disney_brdf.glsl
Created August 13, 2019 01:51
Disney Principled BRDF GLSL shader implementation
// Principled PBR Path tracer. Except where otherwise noted:
// Copyright © 2019 Markus Moenig Distributed under The MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
@egetun
egetun / maya2019install.sh
Last active May 5, 2022 14:36 — forked from nrtkbb/maya2018install.sh
Autodesk Maya 2019 Installation Bash Script v1.0 for Ubuntu 18.04 / Tested on KDE Neon 5.14
#!/bin/bash
#Deniz Ege Tunçay, 2019
#nrtkbb, 2018
#Neal Burger, 2017
#Autodesk Maya Installation Bash Script v1.0 for Ubuntu 18.04 based Linux Distributions
#if you have any issues, feel free tweet me // @egetun
#Make sure we’re running with root permissions.
@wakita
wakita / Makefile
Last active July 21, 2023 08:53
Metal compute shader example
SDK = xcrun -sdk macosx
all: compute.metallib compute
compute.metallib: Compute.metal
# Metal intermediate representation (.air)
$(SDK) metal -c -Wall -Wextra -std=osx-metal2.0 -o /tmp/Compute.air $^
# Metal library (.metallib)
$(SDK) metallib -o $@ /tmp/Compute.air
@fnky
fnky / ANSI.md
Last active April 3, 2025 21:13
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
% Some predefined strings for conferences & journals
@string{AAAI = "Conference on Artificial Intelligence (AAAI)"}
@string{AISTATS = "International Conference on Artificial Intelligence and Statistics (AISTATS)"}
@string{Bernoulli = "Bernoulli"}
@string{Biometrika = "Biometrika"}
@string{CandG = "Computers \& Graphics"}
@string{CACM = "Commun. ACM"}
@string{CG_SIGGRAPH = "Comput. Graph. (Proc. SIGGRAPH)"}
@string{CGA = "IEEE Comput. Graph. Appl."}
@string{CGF = "Comput. Graph. Forum"}
@CAFxX
CAFxX / Colorized and formatted go tool objdump output.png
Last active July 7, 2023 17:51
Colorized and formatted go tool objdump output
Colorized and formatted go tool objdump output.png