Skip to content

Instantly share code, notes, and snippets.

View xandrucea's full-sized avatar

Alex Cio xandrucea

View GitHub Profile
Using different methods for seeding srand()
from post: http://stackoverflow.com/a/6864328/1141395
time of the day, returns number of seconds elapsed since midnight January 1st, 1970
-----------------------------------------------------------------------------------
time(NULL);
$(ARCHS_STANDARD_INCLUDING_64_BIT)
where to find xCode Snippets
----------------------------
@xandrucea
xandrucea / say
Last active December 18, 2015 22:59
say -v 'pipe organ' Dum dum dee dum dum dum dum dee Dum dum dee dum dum dum dum dee dum dee dum dum dum de dum dum dum dee dum dee dum dum dee dummmmmmmmmmmmmmmmm
osascript -e 'say "Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo" using "Cellos"'
@xandrucea
xandrucea / Device identification
Last active December 18, 2015 15:19
Device identification
check if device is jailbraiked
(Not all users have installed Cydia, maybe check any root dir outside the sandbox -->/bin/usr)
------------------------------
NSString *filePath = @"/Applications/Cydia.app";
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
// do something useful
}
@xandrucea
xandrucea / View Snippets
Last active December 18, 2015 15:19
UIView Snippets
int count = 0;
for(UIView *v in [actualView subviews]){
if([v isMemberOfClass:[UIView class]]){
NSLog(@"Aktual View %d: %@", count, v);
count++;
}
}
- (void)printMyFrame:(CGRect)aFrame{
@xandrucea
xandrucea / gist:5635627
Created May 23, 2013 12:10
Creating delegates
In Klasse die das delegate erhalten soll:
@protocol CustomAlertDelegate <NSObject>
-(void)dismissMyViewController:(UIViewController *)aViewController;
@end
define the delegate property:
@xandrucea
xandrucea / Apple Sample Projects
Last active December 16, 2015 05:59
Explanation about content of downloaded sample projects from apple
Advanced Sample Project
------------------------------
https://developer.apple.com/library/ios/#samplecode/AdvancedTableViewCells/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009111
AdvancedTableViewCells includes three different cells that all display content in the same form as the App Store application. One uses individual subviews (image views, labels, etc.) to display the content. Another uses a single view that draws all of the content. A third uses a single view to draw most of the content and separate views for the remainder.
International Mountains
------------------------------
//
// TumblrCheckViewController.m
// TumblrCheck
//
// Created by Alexandru Ciocea on 11.04.13.
// Copyright (c) 2013 ImprovingSkills. All rights reserved.
//
#define kAsyncModus dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
#define kTumblURL [NSURL URLWithString: @"http://trainbrainstorm.tumblr.com/api/read/json"]
#define kAnotherURL [NSURL URLWithString: @"http://api.kivaws.org/v1/loans/search.json?status=fundraising"]