Skip to content

Instantly share code, notes, and snippets.

View karosLi's full-sized avatar
🎯
Focusing

Karosli karosLi

🎯
Focusing
View GitHub Profile
@karosLi
karosLi / Makefile
Created September 28, 2022 03:52 — forked from wakita/Makefile
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
@karosLi
karosLi / Notes.md
Created September 28, 2022 03:53 — forked from mhamilt/Notes.md
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.

@karosLi
karosLi / UIImage_ImageHelper.h
Created February 2, 2023 10:17 — forked from JoeOsborn/UIImage_ImageHelper.h
A UIImage to BGRA8 conversion category
/*
* The MIT License
*
* Copyright (c) 2011 Paul Solt, PaulSolt@gmail.com
* Modifications Copyright (c) 2011 Joe Osborn, josborn@universalhappymaker.com
*
* 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
@karosLi
karosLi / command.txt
Created November 2, 2023 06:24 — forked from nrk/command.txt
Using ffprobe to get info from a file in a nice JSON format
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"