This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Any.prettyPrint(): String { | |
var indentLevel = 0 | |
val indentWidth = 4 | |
fun padding() = "".padStart(indentLevel * indentWidth) | |
val toString = toString() | |
val stringBuilder = StringBuilder(toString.length) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The MIT License (MIT) | |
// | |
// Copyright (c) 2016 Jansel Valentin | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env = Environment( | |
CCFLAGS = ['-Wall', '-Werror'], | |
) | |
env.Program('mkdir_p_test', ['mkdir_p.c', 'test.c']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DraggableClipView: NSClipView | |
{ | |
private var clickPoint: NSPoint! | |
private var originalOrigin: NSPoint! | |
override func mouseDown(event: NSEvent) { | |
clickPoint = event.locationInWindow | |
originalOrigin = bounds.origin | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${SOURCE_ROOT}/${INFOPLIST_FILE}") | |
BUILD=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${SOURCE_ROOT}/${INFOPLIST_FILE}") | |
# The build number gets automatically increased by a build phase | |
BUILD=$((BUILD - 1)) | |
DATE=$(/bin/date +%Y%m%d%H%M%S) | |
OUTPUT_DIR="${HOME}/Desktop/${TARGET_NAME}_v${VERSION}b${BUILD}_${DATE}" | |
mkdir "$OUTPUT_DIR" | |
# Zip and copy .dSYM | |
cd "${ARCHIVE_DSYMS_PATH}/" | |
/usr/bin/zip -r "$OUTPUT_DIR/${TARGET_NAME}.dSYM.zip" "${TARGET_NAME}.app.dSYM" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
--------------------------------------------------------------------------------------- | |
Obj-C Literal Dictionary Syntax - Multiple reasons for allowing nil values | |
Radar 19747372 | |
--------------------------------------------------------------------------------------- | |
The obj-c literal syntax for dictionaries does not allow nils. | |
@{key : nil}; // Exception (and compiler error) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//UITextView subclass for supporting string, regex search and highlighting | |
//Created by Ivano Bilenchi on 05/11/13 | |
//ICAppDelegate.h | |
@interface ICAppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACTION | |
AD_HOC_CODE_SIGNING_ALLOWED | |
ALTERNATE_GROUP | |
ALTERNATE_MODE | |
ALTERNATE_OWNER | |
ALWAYS_SEARCH_USER_PATHS | |
ALWAYS_USE_SEPARATE_HEADERMAPS | |
APPLE_INTERNAL_DEVELOPER_DIR | |
APPLE_INTERNAL_DIR | |
APPLE_INTERNAL_DOCUMENTATION_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)printFreeMemory | |
{ | |
return; | |
mach_port_t host_port; | |
mach_msg_type_number_t host_size; | |
vm_size_t pagesize; | |
host_port = mach_host_self(); | |
host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); |
NewerOlder