Skip to content

Instantly share code, notes, and snippets.

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

Gaurav Gupta ggthedev

🏠
Working from home
  • COMING SOON
  • India
  • 13:31 (UTC +05:30)
View GitHub Profile
@ggthedev
ggthedev / RunScriptBuildPhaseToGenerateDynamicallyLinkedExecutable.sh
Created June 6, 2024 15:17 — forked from banjun/RunScriptBuildPhaseToGenerateDynamicallyLinkedExecutable.sh
Generate Swift CLI executable from Xcode target, with CocoaPods Frameworks and Swift stdlibs, without statically linked with the stdlibs
FRAMEWORK_ARG=$(for f in $(echo "${FRAMEWORK_SEARCH_PATHS}"); do echo -n "-F$f "; done)
RUNPATH_ARG=$(for p in $(echo $LD_RUNPATH_SEARCH_PATHS); do echo -n "-Xlinker -rpath -Xlinker $p "; done)
LD="${DT_TOOLCHAIN_DIR}/usr/bin/clang -arch ${arch} -isysroot ${SDKROOT} -L${CONFIGURATION_BUILD_DIR} ${FRAMEWORK_ARG} -filelist ${LINK_FILE_LIST_normal_x86_64} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} ${RUNPATH_ARG} -fobjc-link-runtime -L${DT_TOOLCHAIN_DIR}/usr/lib/swift/macosx -lc++ -framework Foundation -Xlinker -add_ast_path -Xlinker ${OBJECT_FILE_DIR_normal}/${arch}/${EXECUTABLE_NAME}.swiftmodule -Xlinker -dependency_info -Xlinker ${LD_DEPENDENCY_INFO_FILE} -o ${CONFIGURATION_BUILD_DIR}/${EXECUTABLE_NAME}"
echo "$LD"
zsh -c "$LD"
mkdir -p "${CONFIGURATION_BUILD_DIR}/Frameworks"
for f in ${CONFIGURATION_BUILD_DIR}/*/*.framework; do
cp -r "$f" "${CONFIGURATION_BUILD_DIR}/Frameworks/"
done
@ggthedev
ggthedev / multiple-ssh-keys-git.adoc
Created October 28, 2023 10:31 — forked from alejandro-martin/multiple-ssh-keys-git.adoc
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@ggthedev
ggthedev / launchd-for-services.md
Created June 19, 2023 16:36 — forked from johndturn/launchd-for-services.md
Overview of using launchd to set up services on a macOS machine.

launchd - Script Management in macOS

What is it?

  • Used on macOS for managing agents and daemons and can be used to run scripts at specified intervals
    • macOS's competitor to cron, along with other things
  • Runs Daemons and Agents

What is a Daemon?

@ggthedev
ggthedev / README.md
Created May 23, 2023 19:17 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@ggthedev
ggthedev / iterm2-solarized.md
Created April 12, 2020 06:29 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ggthedev
ggthedev / universal-framework.sh
Created September 30, 2018 19:56 — forked from cromandini/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@ggthedev
ggthedev / delete_git_submodule.md
Created September 30, 2018 19:54 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@ggthedev
ggthedev / FilterScriptPhase.sh
Created September 30, 2018 19:20 — forked from steipete/FilterScriptPhase.sh
This filter script phase is required to remove unused architectures from your application, which would be flagged as issue during upload to the Apple AppStore. Read more at http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@ggthedev
ggthedev / clean_old_code_simulators.sh
Created September 10, 2018 03:42 — forked from jonathan-beebe/clean_old_code_simulators.sh
Clean out unused Xcode Simulators
# Close Xcode & the iOS Simulator
# http://stackoverflow.com/a/30940055
# Remove any old runtimes from this directory.
cd /Library/Developer/CoreSimulator/Profiles/Runtimes
# e.g.
sudo rm -rf iOS\ 8.1.simruntime
# http://stackoverflow.com/a/11790983
# Remove the download receipts for simulators you don't need anymore.