Skip to content

Instantly share code, notes, and snippets.

View alikaragoz's full-sized avatar
🍉
Tap Tap Tap

Ali Karagoz alikaragoz

🍉
Tap Tap Tap
View GitHub Profile
@alikaragoz
alikaragoz / xc-build-increment.sh
Created March 12, 2012 21:24
Xcode Build Increment
#!/bin/bash
buildPlist=${INFOPLIST_FILE}
bundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $buildPlist)
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $buildPlist)
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" $buildPlist
@alikaragoz
alikaragoz / .txt
Created January 1, 2013 15:21
LLDB Config
// Recursive description
command regex rd 's/^[[:space:]]*$/po [[UIApp keyWindow] recursiveDescription]/' 's/^(.+)$/po [%1 recursiveDescription]/'
// Reveal
command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2);
command alias reveal_load_dev expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2);
command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:nil];
@alikaragoz
alikaragoz / ssh-autologin.sh
Created January 1, 2013 15:22
ssh autologin
# Generade ssh keys
ssh-keygen -t rsa
# Make sure the proper rights are set
chmod 700 ~/.ssh
# Append the public key to the remote hosts authorized keys
cat ~/.ssh/id_rsa.pub | ssh -l remoteuser remoteserver.com 'cat >> ~/.ssh/authorized_keys'
# You can now login on the remote server without pasword
@alikaragoz
alikaragoz / post.sh
Created January 1, 2013 15:25
Blog post
#!/bin/sh
# We get the path of the current directory and we move in it
DIR=$(cd "$(dirname "$0")"; pwd)
cd $DIR
# Creating full and thumbnails images folders
FULL_IMG="full"
THUMB_IMG="thumb"
mkdir $FULL_IMG
#
# Be sure to run `pod spec lint Example.podspec.podspec' to ensure this is a
# valid spec.
#
# Remove all comments before submitting the spec. Optional attributes are commented.
#
# For details see: https://github.com/CocoaPods/CocoaPods/wiki/The-podspec-format
#
Pod::Spec.new do |s|
s.name = "Example.podspec"
@alikaragoz
alikaragoz / hoseyfy.applescript
Created June 5, 2013 14:00
AppleScript that will Hoseyify all your currently-open Xcode project warnings. http://rentzsch.tumblr.com/post/237349423/hoseyifyxcodewarnings-scpt
property kHoseyXcodeWarningSettings : {
{"GCC_WARN_CHECK_SWITCH_STATEMENTS", "YES"},
{"GCC_WARN_SHADOW", "YES"},
{"GCC_WARN_64_TO_32_BIT_CONVERSION", "YES"},
{"GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED", "YES"},
{"GCC_WARN_ABOUT_RETURN_TYPE", "YES"},
{"GCC_WARN_MISSING_PARENTHESES", "YES"},
{"GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS", "YES"},
{"GCC_WARN_ABOUT_MISSING_NEWLINE", "YES"},
{"GCC_WARN_SIGN_COMPARE", "YES"},
/**
* Several macros simplifying use of weak references to self inside blocks
* which goal is to reduce risk of retain cycles.
*
* Version 2. Uses GCC statement expressions
* instead of capturing self via block closure.
*
* Example:
* @code
@alikaragoz
alikaragoz / xc.sh
Last active December 23, 2015 18:39
Find and open the first xcworkspace or xcodeproj in a folder.
xc () {
workspaces=(`ls -d1 *.(xcworkspace|xcodeproj) | sed -e "s/\///g"`) &> /dev/null
filenames=(`ls -d1 *.(xcworkspace|xcodeproj) | sed -e "s/\..*$//g"`) &> /dev/null
if [[ ${#workspaces} = 0 ]]
then
echo "No Xcode projects or workspaces were found."
return
fi
@alikaragoz
alikaragoz / block-syntax
Created January 19, 2014 19:42
How Do I Declare A Block in Objective-C? source : http://fuckingblocksyntax.com
// As a local variable.
returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...};
// As a property.
@property (nonatomic, copy) returnType (^blockName)(parameterTypes);
// As a method parameter.
- (void)someMethodThatTakesABlock:(returnType (^)(parameterTypes))blockName {...}
// As an argument to a method call.