Skip to content

Instantly share code, notes, and snippets.

View yuhanle's full-sized avatar
💭
I may be slow to respond.

Yuhanle yuhanle

💭
I may be slow to respond.
View GitHub Profile
@skymobilebuilds
skymobilebuilds / carthage-xc12.sh
Last active May 17, 2022 12:36
Xcode 13 and 12 Carthage Build Workaround
#!/bin/bash -e
echo "🤡 Applying carthage 12 and 13 workaround 🤡"
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' > $xcconfig
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig
@oxlb
oxlb / xcode-uninstall.sh
Created July 23, 2020 06:25
SH file to uninstall Xcode from MacOS
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf /Applications/Xcode.app
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Developer
rm -rf ~/Library/MobileDevice
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist
@lilydjwg
lilydjwg / gh-check
Last active March 18, 2024 04:43
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
1. Add symbolic breakpoint
2. Symbol: -[UIViewController dealloc]
3. Add 2 action, Log Message and Sound
4. Edit command on Log Message Action:
--- dealloc @(id)[$arg1 description]@ @(id)[$arg1 title]@
@jlawton
jlawton / carthage-graph.pl
Created October 24, 2017 05:38
Resolved Carthage dependency grapher
#!/usr/bin/env perl -w
use strict;
use Text::ParseWords qw(quotewords);
# Returns [DependencyName]
sub parseCartfile {
open(my $fh, '<', $_[0]) or die "Cannot open file $_[0]";
my @entries = ();
while (my $line = <$fh>) {
@artemsky
artemsky / bash
Created March 29, 2017 15:03
GIT - Get parent branch
git show-branch | grep '*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
@DmitryBespalov
DmitryBespalov / EmbedFrameworksScript.sh
Last active June 11, 2021 21:10
Embed frameworks script
#!/bin/sh
set -e
# set your Frameworks path here
FRAMEWORKS_DIR="${SRCROOT}/../Frameworks/${PLATFORM_NAME}"
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
@akesson
akesson / UIImageMetalExtensions.swift
Last active July 29, 2023 19:33
[iOS] Extension for creating UIImage from Metal texture
// http://blog.human-friendly.com/drawing-images-from-pixel-data-in-swift
// https://github.com/FlexMonkey/MetalReactionDiffusion/blob/1ea9aa4a841d20e0b247505fdf716cd5fe1a01fd/MetalReactionDiffusion/ViewController.swift
public struct PixelData {
var a:UInt8 = 255
var r:UInt8
var g:UInt8
var b:UInt8
}