Skip to content

Instantly share code, notes, and snippets.

View neonichu's full-sized avatar
🤬
GitHub, cancel your contract with ICE!

Boris Bügling neonichu

🤬
GitHub, cancel your contract with ICE!
View GitHub Profile
@jbgo
jbgo / debug_system_stack_error.md
Created January 9, 2013 15:08
debug SystemStackError in ruby 1.9

This is how I debug SystemStackError when there is no stack trace.

My first attempt was:

begin
  a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
  puts caller
end
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name=$inputline
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url=$inputline
@mattt
mattt / uiappearance-selector.md
Last active June 4, 2024 13:28
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@mtitolo
mtitolo / contributing.md
Last active December 16, 2015 17:29
Cocoapods Guides Refresh

How can I contribute?

Picking Up Issues

####Issue Classifications

  • Defect: These are known bugs. The issue should also contain steps to reproduce. Feel free to fix these and submit a pull request.
  • Enhancement: These are planned enhancements that have not been picked up yet. If you would like to work on one, please add a comment that you are doing so.
  • Discussion: These are issues that can be non-issues, and encompass best practices, or plans for the future.
  • Quick: These are small issues, that should be able to be fixed quickly. Normally these issues don't stay around for very long.
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API
@luisobo
luisobo / README.md
Last active January 14, 2016 14:19
Hide iOS Simulator when running Unit Tests.

Hide iOS Simulator when running Unit Tests.

Based on this work, that @Dan2552 pointed out.

Instructions:

  1. Clone this gist (git clone https://gist.github.com/6201428.git hide_ios_simulator)
  2. Xcode -> Preferences -> Behavior -> Testing -> Generates output
  3. Run script -> Choose script -> Select hide_simulator
@aras-p
aras-p / preprocessor_fun.h
Last active May 28, 2024 05:15
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@steipete
steipete / UIKitLegacyDetector.m
Last active March 12, 2024 13:57
A simple way to detect at runtime if we're running in UIKit legacy mode or the new "flat" variant. Written for our PDF iOS SDK (http://pspdfkit.com), where the precompiled binary needs to detect at runtime in what variant it's running. Want more stuff like that? Follow me on Twitter: http://twitter.com/steipete
// Taken from http://PSPDFKit.com. This snippet is under public domain.
#define UIKitVersionNumber_iOS_7_0 0xB57
BOOL PSPDFIsUIKitFlatMode(void) {
static BOOL isUIKitFlatMode = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7.
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0;
}
@luisobo
luisobo / gist:6620798
Created September 19, 2013 08:52
Xcode 5 IDEWorkspace NSView hierarchy
0x00007f944f5f4b30 [ A LU ] h=-&- v=-&& NSView 0x7f944d03da60 f=(0,0,1400,823) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ A LU ] h=&&& v=-&- DVTTabSwitcher 0x7f944d042280 f=(0,0,1400,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ AF LU ] h=-&- v=-&- NSTabView 0x7f944d0425c0 f=(0,0,1400,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.01 ms
[ A LU ] h=-&- v=-&- DVTControllerContentView 0x7f944d97ee50 f=(0,0,1400,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ AF P LU ] h=--- v=--- DVTSplitView 0x7f944d99afc0 f=(0,0,1400,821) b=(-) TIME drawRect: min/mean/max 0.01/0.08/0.80 ms
[ H LU ] h=-&- v=-&- DVTReplacementView 0x7f944d9eac40 f=(-260,0,260,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ hA LU ] h=-&- v=-&- DVTControllerContentView 0x7f944d963fa0 f=(0,0,260,821) b=(-) TIME drawRect: min/mean/max 0.00/0.00/0.00 ms
[ hA LU ] h=--- v=--- NSView 0x7f944d965280
@LegNeato
LegNeato / gist:6739175
Created September 28, 2013 06:38
Xcode accept license
# We have to accept the Xcode license.
params = {
# Release.
'IDELastGMLicenseAgreedTo' => 'EA1057',
'IDELastVersionOfXcodeThatRegisteredLaunchServicesItems' => '5.0',
'IDEXcodeVersionForAgreedToGMLicense' => '5.0',
# Beta.
'IDELastBetaLicenseAgreedTo' => 'EA1027',
'IDEXcodeVersionForAgreedToBetaLicense' => '5.0',
}