Skip to content

Instantly share code, notes, and snippets.

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

rkt orklann

🏠
Working from home
View GitHub Profile
@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
[
{
"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 / 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"
@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

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 / 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"
}
@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
"""
1. Store the image and create an instance of ImagefileProcessHistory with status NOT_STARTED
ImageFileProcessHistory
- local_path
- file_name
- status # enum: NOT_STARTED, STARTED, SUCCEEDED, FAILED
- bytes_processed
- bytes_total
"""
@orklann
orklann / XmlParser.h
Created May 5, 2021 12:53 — forked from jeffkreeftmeijer/XmlParser.h
Objective-C XML parser
#import <Foundation/Foundation.h>
@interface XmlParser : NSObject <NSXMLParserDelegate>
@property (strong, nonatomic) NSData *xmlData;
@property (strong, nonatomic) NSMutableDictionary *dictionary;
@property (strong, nonatomic) NSMutableDictionary *currentNode;
@property (strong, nonatomic) NSMutableDictionary *currentParentNode;
- (id)initWithXMLData:(NSData *)xmlData;
@orklann
orklann / get_title_and_url.applescript
Created February 27, 2021 03:52 — forked from dongyuwei/get_title_and_url.applescript
Applescript to get frontmost tab’s url and title of various browsers.
# Keep in mind that when asking for a `return` after another, only the first one will be output.
# This example is meant as a simple starting point, to show how to get the information in the simplest available way.
# Google Chrome
tell application "Google Chrome" to return URL of active tab of front window
tell application "Google Chrome" to return title of active tab of front window
# Google Chrome Canary
tell application "Google Chrome Canary" to return URL of active tab of front window
tell application "Google Chrome Canary" to return title of active tab of front window
# Chromium