Skip to content

Instantly share code, notes, and snippets.

@jllubia
jllubia / gist:8833ab7b1f920c1b8718333dbb801558
Created September 26, 2025 16:43
iOS 26.0 Core Video Pixel Format Codes
Pixel Format Codes:
===================
kCVPixelFormatType_1Monochrome:
kCVPixelFormatType_2Indexed:
kCVPixelFormatType_4Indexed:
kCVPixelFormatType_8Indexed:
kCVPixelFormatType_1IndexedGray_WhiteIsZero: !
kCVPixelFormatType_2IndexedGray_WhiteIsZero: "
kCVPixelFormatType_4IndexedGray_WhiteIsZero: $
kCVPixelFormatType_8IndexedGray_WhiteIsZero: (
@aibo-cora
aibo-cora / Converter.swift
Created July 17, 2021 19:15
Class to convert AVAudioPCMBuffer to CMSampleBuffer.
import Foundation
import AVFoundation
import CoreMedia
class Converter {
static func configureSampleBuffer(pcmBuffer: AVAudioPCMBuffer) -> CMSampleBuffer? {
let audioBufferList = pcmBuffer.mutableAudioBufferList
let asbd = pcmBuffer.format.streamDescription
var sampleBuffer: CMSampleBuffer? = nil
@munificent
munificent / generate.c
Last active August 29, 2025 13:51
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@jcavat
jcavat / Dockerfile
Last active April 15, 2025 17:40
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@pedromancheno
pedromancheno / HTTP.swift
Created February 21, 2017 11:44
Wrapper for URLSession for making HTTP Requests.
import Foundation
enum Result<T> {
case success(T?)
case failure(Error)
}
enum HTTPError: Error {
case noResponse
case unsuccesfulStatusCode(Int)
@daneden
daneden / Instructions.md
Created December 1, 2015 00:25
Remap Caps Lock to Emoji on Mac

How to remap the caps lock key to the emoji selector on Mac

  1. Go to System Preferences -> Keyboard -> Modifier Keys...
  2. Change “Caps Lock” to “No action”
  3. Install Seil
  4. Change the Caps Lock key in Seil to keyCode 80 (F19)
  5. Install Karabiner
  6. Open Karabiner and go to Misc & Uninstall -> Open private.xml
  7. Copy the contents of this gist's example to the XML file and save
  8. In Karabiner, go to Change Keys -> Reload XML
@djromero
djromero / pre-commit
Last active December 2, 2015 16:50
Git pre-commit hook to detect debugging stuff that shouldn't be commited.
#!/bin/sh
# commit without hook:
# git commit --no-verify
#
declare -i REJECTED
REJECTED=0
red="\033[31m"
reset="\033[m"
#!/bin/sh
#
# Download and install iOS provisioning profiles
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile
@djromero
djromero / update_provisioning_profile.sh
Last active February 6, 2024 12:13
Download and install a single iOS provisioning profile for Xcode
#!/bin/sh
#
# Download and install a single iOS provisioning profile
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile
@shiningabdul
shiningabdul / gist:8634264
Last active September 27, 2024 07:10
Xcode Bot Archive Post-Build Script to Upload Automatically to HockeyApp. Updated from here to use Hockey App: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode/.
# Valid and working as of 04/21/2014
# Xcode 5.0.1, XCode Server
#
#Settings
API_TOKEN="This can be found here: https://rink.hockeyapp.net/manage/auth_tokens"
DISTRIBUTION_LISTS="This is a comma seperated list of tags found under App -> Users -> "
PROVISIONING_PROFILE="You will have to manually copy your profile to /Library/Server/Xcode/Data/ProvisioningProfiles/<profile>.mobileprovision"
#EXAMPLE:"/Library/Server/Xcode/Data/ProvisioningProfiles/DocLink_InHouse_2013.mobileprovision"
NOTIFY="1"