Skip to content

Instantly share code, notes, and snippets.

View Youlean's full-sized avatar

Julijan Nikolic Youlean

View GitHub Profile
@directmusic
directmusic / core_audio_tap_example.m
Created May 10, 2024 20:55
An example how to use the new Core Audio Tap API in macOS 14.2.
// This is a quick example of how to use the CoreAudio API and the new Tapping
// API to create a tap on the default audio device. You need macOS 14.2 or
// later.
// Build command:
// clang -framework Foundation -framework CoreAudio main.m -o tapping
// License: You're welcome to do whatever you want with this code. If you do
// something cool please tell me though. I would love to hear about it!
#ifndef WIN32
#include <dlfcn.h>
#include <stdio.h>
#include <vector>
#if DEBUG
void* malloc(size_t sz) {
static void *(*libc_malloc)(size_t) = nullptr;
if(libc_malloc==nullptr) {
@talaviram
talaviram / add_debug_entitlement.sh
Last active October 22, 2024 14:07
Simple Utility Script for allowing debug of hardened macOS apps.
#! /bin/bash
# Simple Utility Script for allowing debug of hardened macOS apps.
# This is useful mostly for plug-in developer that would like keep developing without turning SIP off.
# Credit for idea goes to (McMartin): https://forum.juce.com/t/apple-gatekeeper-notarised-distributables/29952/57?u=ttg
# Update 2022-03-10: Based on Fabian's feedback, add capability to inject DYLD for sanitizers.
#
# Please note:
# - Modern Logic (on M1s) uses `AUHostingService` which resides within the system thus not patchable and REQUIRES to turn-off SIP.
# - Some hosts uses separate plug-in scanning or sandboxing.
# if that's the case, it's required to patch those (if needed) and attach debugger to them instead.
@kurash
kurash / pkgresign.c
Created October 16, 2019 13:05
Add RSA signature to OSX packages (pkg)
/*
(c) 2012-2016 Sassafras Software Inc.
Provided "as is" under the terms of the MIT license, no warranty, use at your own risk
*/
/*
to build:
cc pkgresign.c -framework Security -framework CoreFoundation -lxar -o pkgresign
*/
@olilarkin
olilarkin / notes.md
Last active November 14, 2024 06:28
Plugin Dev Notes

Best Practices and What’s New with In-App Purchases

Introductory prices

SKProduct.introductoryPrice is an instance of SKProductDiscount. Just like a normal SKProduct, SKProductDiscount has a price and priceLocale. It also has a subscriptionPeriod. This period has a unit in the form of a month, week, month, year and a number of units. For instance 3 month units is possible. There is also a numberOfPeriods. Another property on SKProductDiscount is paymentMode.

If you have a 3 month cycle for your subscriptions, you can offer 6 months of access for a discount by setting numberOfPeriods to 2. If you set paymentMode to payAsYouGo, the user pays the second period after the first ends. You could also do a payUpFront setting so the user will pay the first two periods all at once. After the 6 month trial is up, the next renewal is for three months.

The last paymentMode is freeTrial, this gives the entire introductory period to the user for free.

Since iOS 11.2, subscriptionPeriod

@vielhuber
vielhuber / script.sh
Last active October 10, 2024 20:00
ffmpeg: Video convert m2ts to mp4, mp4 to webm, mp4 to ogv #tools
MP4 TO MP4 (MEDIUM)
ffmpeg -i input.mp4 -b 1000000 output.mp4
M2TS TO MP4
ffmpeg -i input.m2ts -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" output.mp4
MP4 TO WEBM (HIGH)
ffmpeg -i input.mp4 -aq 5 -ac 2 -qmax 25 -threads 2 output.webm
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -b:a 128k -c:a libopus output.webm
@bmatcuk
bmatcuk / symbolizing_osx_crash_logs.md
Created May 29, 2014 21:43
How to symbolize OSX crash logs

How to Symbolize OSX Crash Logs

Unfortunately, xcode does not yet have support for importing OSX crash logs and symbolizing them. Therefore, you must use the command line and a little bit of manual work.

  1. Find your dSYM file.
    1. Assuming you are using xcode's archive functionality, open the Organizer window from the Window menu.
    2. Click the Archives tab.
    3. Right click on the appropriate build and select Show in Finder.
    4. When Finder opens, right click on the selected archive and select Show Package Contents.
    5. Navigate to the dSYM directory and copy the appropriate dSYM file to a temporary directory.
  2. Then navigate to Products, then Applications, and copy the app file to the same temporary directory.