Skip to content

Instantly share code, notes, and snippets.

View orklann's full-sized avatar
🏠
Working from home

Tommy Jeff orklann

🏠
Working from home
View GitHub Profile
@orklann
orklann / brew-perms.sh
Created May 24, 2021 12:47 — forked from jaibeee/brew-perms.sh
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@orklann
orklann / keystroke-toggle-linenumbers-settings.json
Created July 15, 2021 13:09 — forked from pid/keystroke-toggle-linenumbers-settings.json
Sublime Text keystroke toggle line numbers show/hide
{
"keys": ["ctrl+alt+l"],
"command": "toggle_setting",
"args": {
"setting": "line_numbers"
}

Real depth in OpenGL / GLSL

http://olivers.posterous.com/linear-depth-in-glsl-for-real

So, many places will give you clues how to get linear depth from the OpenGL depth buffer, or visualise it, or other things. This, however, is what I believe to be the definitive answer:

This link http://www.songho.ca/opengl/gl_projectionmatrix.html gives a good run-down of the projection matrix, and the link between eye-space Z (z_e below) and normalised device coordinates (NDC) Z (z_n below). From there, we have

A   = -(zFar + zNear) / (zFar - zNear);

B = -2zFarzNear / (zFar - zNear);

@orklann
orklann / 32.asm
Last active February 10, 2022 14:11 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X(get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@orklann
orklann / mac-enable-libfuzzer.md
Created February 20, 2022 03:33 — forked from mcandre/mac-enable-libfuzzer.md
macOS Enable libFuzzer
  1. Run brew install llvm --HEAD.
  2. Update certain shell variables:
# Prefer newer LLVM with fuzzing enabled
# shellcheck source=/dev/null
export CC='clang'
export CXX='clang++'
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
PATH="$(brew --prefix)/opt/llvm/bin:$PATH"
[
{
"name": "NHK FM",
"status": "ACTIVE",
"country_code": "jp",
"country_name": "Japan",
"streams": [
{
"quality": 0,
"url": "https://nhkradioakfm-i.akamaihd.net/hls/live/512290/1-fm/1-fm-01.m3u8"
@orklann
orklann / BBC-Radio-HLS-UK.m3u
Created June 19, 2022 06:08 — forked from bpsib/BBC-Radio-HLS.m3u
BBC Radio Streams
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_radio_one.m3u8
#EXTINF:-1,BBC - Radio 1Xtra
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_1xtra.m3u8
#EXTINF:-1,BBC - Radio 1Dance
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_radio_one_dance.m3u8
#EXTINF:-1,BBC - Radio 1Relax
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_radio_one_relax.m3u8
#EXTINF:-1,BBC - Radio 2