Skip to content

Instantly share code, notes, and snippets.

View PaulEhrhardt's full-sized avatar
:octocat:

Paul Ehrhardt PaulEhrhardt

:octocat:
  • grandcentrix GmbH
  • Spain
View GitHub Profile
@PaulEhrhardt
PaulEhrhardt / Xcode .gitignore template
Last active June 23, 2019 11:14
An Xcode 8 .gitignore template for use with Objective-C and Swift
############################
# OS X temporary files #
############################
.Trashes
.DS_Store
*.swp
*.lock
############################
# Xcode temporary files #
@PaulEhrhardt
PaulEhrhardt / gist:0209e82768188afb155375b0c2a85c2a
Created May 31, 2016 09:05
Delete all merged local branches
git branch --merged | grep -v "\*" | grep -v master | grep -v develop | grep -v release | xargs -n 1 git branch -d

###Note Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

###[UPDATE : Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.]

###[UPDATE 2:The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead]

Sometimes we need to open Setting's Preferences not of our app, but of the iPhone itself. What should we do to acomplish this?

@PaulEhrhardt
PaulEhrhardt / gpg-with-key
Created December 21, 2016 11:27 — forked from stansidel/gpg-with-key
Setting up GPG signature on Mac OS X with Xcode
/usr/local/bin/gpg --batch --passphrase-file ~/.gnupg/key.txt --no-tty "$@"
@PaulEhrhardt
PaulEhrhardt / launch_sublime_from_terminal.markdown
Created January 6, 2017 12:36 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@PaulEhrhardt
PaulEhrhardt / GPG and git on macOS.md
Created March 6, 2017 10:20 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@PaulEhrhardt
PaulEhrhardt / gist:7779c41bac8edbda25404958606be55d
Created June 7, 2017 09:47
Doxyfile template for Objective-C
# Doxyfile 1.8.13
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
@PaulEhrhardt
PaulEhrhardt / ios_swift_universal_framework_build_script.sh
Last active July 7, 2020 08:09
iOS universal library build script supporting swift modules, including dSYM and simulator slices
#!/bin/sh
# iOS universal library build script supporting swift modules, including dSYM and simulator slices
# prevention from running xcodebuild in a recusive way
if [ "true" == ${ALREADYINVOKED:-false} ]; then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
# path defines including output directory for universal framework
049545de553900a569ad9fdd977c245b37bf927e48052779b8f60d35d824ba776b6a6b94f3384eb7ea1dbf3870f316ea57264520226cdb97a441892ae506d99d23;mRs-
@PaulEhrhardt
PaulEhrhardt / stars.sh
Created March 11, 2019 10:51 — forked from sebble/stars.sh
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo