Skip to content

Instantly share code, notes, and snippets.

View dbarden's full-sized avatar

Daniel Barden dbarden

View GitHub Profile
@danielmartin
danielmartin / BetterXcodeJumpToCounterpartSwift.org
Last active March 9, 2024 02:00
Add support for a better Xcode's Jump to Next Counterpart in Swift

If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).

You can do this in recent versions of Xcode by setting a configuration default.

From a terminal, just type this command and press Enter:

defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"
@steipete
steipete / gist:12c73d1b4dc1e933e15d
Last active June 26, 2019 22:48
Since some asked, these are the specs for my new hell machine. (https://twitter.com/steipete/status/697675524286627840). I got most of the parts on Amazon, keep an eye out for their warehouse deals, great savings for usually just damaged boxes.
Fractal Design Define S Black
Corsair CP-9020094-EU RMX Serie RM1000X ATX/EPS (if you don't do SLI 850W is good enough)
Asus ROG Maximus VIII Hero Gaming Mainboard
Corsair CMK32GX4M4A2400C14 Vengeance LPX 32GB
Intel Core™ i7-6700K
Noctua NH-D15S
Samsung Basic MZ-7KE1T0BW 850 Pro SSD (no space for an PCI-E version...)
Western Digital WD40EZRX Caviar Green 4TB (optional)
@steipete
steipete / Warnings.xcconfig
Last active February 1, 2020 15:06
The warnings configuration we use in the PSPDFKit iOS framework - http://pspdfkit.com
//
// Warnings.xcconfig
//
// The list of warnings we (don’t) use, and the reasons why.
//
// :MARK: Warnings in use:
// :MARK: -everything
// We want the best possible diagnostics, so we simply enable everything that exists, and then opt–out of what doesn’t make sense for us.
//
// :MARK: - Warnings not to be promoted:
@jbenet
jbenet / simple-git-branching-model.md
Last active June 14, 2024 17:16
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@0xced
0xced / Makefile
Created March 23, 2012 15:02
Experiment ->isa vs object_getClass()
OPTIONS = metaclass.m -o metaclass -std=c99 -framework Foundation -arch x86_64 -Os
isa:
clang -DUSE_ISA=1 $(OPTIONS)
./metaclass
object_getClass:
clang -DUSE_ISA=0 $(OPTIONS)
./metaclass
@streeter
streeter / pre-commit.py
Created November 18, 2011 16:02
Python .git/hooks/pre-commit hook
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [
@0xced
0xced / NSURLBug.m
Created July 6, 2011 15:09
Demonstrates NSURL crash when subclassing, see http://www.openradar.me/9729706
#import <Foundation/Foundation.h>
@interface MyURL : NSURL
@end
@implementation MyURL
@end
void testURL(Class urlClass, NSString *string)
{
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
#
# Generate an SVN-compatible diff against the tip of the tracking branch
# Get the tracking branch (if we're on a branch)
TRACKING_BRANCH=`git svn info | grep URL | sed -e 's/.*\/branches\///'`