Skip to content

Instantly share code, notes, and snippets.

@Noreaster76
Noreaster76 / README.md
Created August 1, 2023 15:50
Add two integers together that were given as linked lists

This gist is a practice exercise TDDing a solution to a coding interview question on CoderPad. I used this as a template.

# DISCLAIMER: THE BELOW IS LESS-THAN-TERRIFIC RUBY. IT IS JUST SOMETHING I WHIPPED UP QUICKLY.
# This is a script for iterating over, in order of oldest to newest, all
# commits in all GitHub pull requests that were merged into a particular
# branch, and cherry-picking them onto the currently checked-out branch.
# It's useful for creating a copy of, say, a feature branch that was branched
# off a branch you did not want it to be, but that feature branch is too
# complex to simply rebase elsewhere.
#
# Usage:
require 'Slop'
require 'Xcodeproj'
DEFAULT_PROJECT_FILE = 'Foo/Bar.xcodeproj'
opts = Slop.parse do |o|
o.string '-t', '--target', 'the name of the test target from which you want to remove all other spec files'
o.array '-k', '--keep', 'either a single file, or a comma-separated list of files that you want to keep in the test target; all other files matching /Spec.m$/ will be removed; note that you can submit --keep a.m --keep b.m, if you don\'t want to use a comma-separated list', delimiter: ','
o.string '-p', '--project', "the project file containing the test target you want to modify; default is #{DEFAULT_PROJECT_FILE}", default: DEFAULT_PROJECT_FILE
o.on '-h', '--help', 'print this help message' do
@Noreaster76
Noreaster76 / gist:d51b2d0780a2a957783f
Last active August 29, 2015 14:19
How to find the NSUserDefaults PList file in Xcode 6 / iOS 8
cd ~/Library/Developer/CoreSimulator/Devices
# get a unique list of all the PList files below this directory
find . -name '*.plist' -exec basename {} \; | sort -u
# get a list of all xyz PList files
find . -name '*.plist' -exec basename {} \; | grep -i xyz
# find all those com.xyz.plist files below the current directory
find . -name com.xyz.plist -ls