Skip to content

Instantly share code, notes, and snippets.

View rayray's full-sized avatar

Raymond Edwards rayray

View GitHub Profile
require_relative './helpers/config_item_validation_helpers'
require 'trainer'
module Fastlane
module Actions
class ExportBitriseTestReportAction < Action
extend ConfigItemValidationHelpers
class Runner
attr_reader :name, :xcresult_path, :test_result_dir, :deploy_dir
@rayray
rayray / xcresult_diagnostics_dump.sh
Created August 15, 2023 20:26
extract diagnostics folder from an xcresult
#!/bin/bash
# Raymond Edwards
# extract diagnostics folder from an xcresult. this script assumes jq is installed
# if Diagnostics/ already exists, xcresulttool will overwrite it
XCRESULT="${1}"
DIAGNOSTICS_ID=$(xcrun xcresulttool get --format json --path "${XCRESULT}" | jq -r '."actions"."_values"[0]."actionResult"."diagnosticsRef"."id"."_value"')
@rayray
rayray / fix_FB11645580.mm
Created December 13, 2022 05:01 — forked from saagarjha/fix_FB11645580.mm
Fix an Xcode hang caused by FB11645580 due to IDERunDestination registering thousands of duplicate KVO observers
// https://gist.github.com/saagarjha/ed701e3369639410b5d5303612964557
#import "swizzler.h"
#import <Foundation/Foundation.h>
#import <cstddef>
#import <cstdlib>
#import <dlfcn.h>
#import <mach-o/dyld.h>
#import <mutex>
#import <string>
#import <tuple>
@rayray
rayray / library_injector.cpp
Created December 13, 2022 04:53 — forked from saagarjha/library_injector.cpp
Load a library into newly spawned processes (using DYLD_INSERT_LIBRARIES and EndpointSecurity)
// To compile: clang++ -arch x86_64 -arch arm64 -std=c++20 library_injector.cpp -lbsm -lEndpointSecurity -o library_injector,
// then codesign with com.apple.developer.endpoint-security.client and run the
// program as root.
#include <EndpointSecurity/EndpointSecurity.h>
#include <algorithm>
#include <bsm/libbsm.h>
#include <cstdint>
#include <cstdlib>
#include <cstring>
@rayray
rayray / HNApi.js
Created October 2, 2018 19:05 — forked from Swizec/HNApi.js
Unofficial HackerNews write API wrapper
import cheerio from 'cheerio-without-node-native';
const convertRequestBodyToFormUrlEncoded = (data) => {
const bodyKeys = Object.keys(data);
const str = [];
for (let i = 0; i < bodyKeys.length; i += 1) {
const thisKey = bodyKeys[i];
const thisValue = data[thisKey];
str.push(`${encodeURIComponent(thisKey)}=${encodeURIComponent(thisValue)}`);
@rayray
rayray / flac2mp3.rb
Created June 26, 2012 20:46 — forked from mxcl/flac2mp3.md
Simple FLAC to MP3 converter, allows for V2..V0|320CBR.
moved to https://github.com/rmndk/flac2mp3