Skip to content

Instantly share code, notes, and snippets.

View eytanschulman's full-sized avatar

Eytan Schulman eytanschulman

View GitHub Profile
@eytanschulman
eytanschulman / gist:8521776
Created January 20, 2014 15:20
How to make UIActivityViewController not lag
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self presentViewController:activityVC animated:YES completion:^{
}];
}];
@eytanschulman
eytanschulman / iOS Crash
Created February 24, 2014 07:28
This is the crash I get in my output when I tap on a button that launches a UIActionSheet
2014-02-24 09:25:10.553 Staff Manager[403:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Sheet can not be presented because the view is not in a window: <UIView: 0x18a497c0; frame = (0 0; 320 568); autoresize = RM+BM; layer = <CALayer: 0x18a4a430>>'
Basically heres the situation: I have a menu controller using REFrostedViewController(can be found here: https://github.com/romaonthego/REFrostedViewController). The menu controller is working perfectly for everything but this, I tap on a cell in my menu, it dismisses the menu to goto the view it is on already and to call an action sheet, this is what happens.
Here is my code to call the action sheet:
reportssheet = [[UIActionSheet alloc] initWithTitle:@"Choose Your Report" delegate:self cancelButtonTitle:@"Canel" destructiveButtonTitle:nil otherButtonTitles:@"Class List",@"Grade (Student)",@"Attendance Total (Student)",@"Assignment Grade (Class)",@"Assignment Grade (Student)", @"Assignments Given (Class)",@"Weighted

Keybase proof

I hereby claim:

  • I am zorcan1 on github.
  • I am zorcan1 (https://keybase.io/zorcan1) on keybase.
  • I have a public key whose fingerprint is CDFF 46D8 4926 8D4F 13A7 F576 F201 1E21 02F3 E2BE

To claim this, I am signing this object:

-(void)changeButtonBackgroundWithAnimation:(UIButton *)button andBackground:(UIImage *)background withDuration:(CFTimeInterval)aduration {
[button setImage:background forState:UIControlStateNormal];
CATransition *transition = [CATransition animation];
transition.duration = aduration;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[button.layer addAnimation:transition forKey:nil];
}
@eytanschulman
eytanschulman / gist:ee26321caf7646e83837
Created August 17, 2014 19:26
!CGRectIntersectsRect
if (!CGRectIntersectsRect(appFrame, mapButton.frame)) {
}
@eytanschulman
eytanschulman / TechProb
Created August 25, 2014 19:43
Random Tech Support Problem With Apple TV & Projector
Tech support question: In my school we have ATVs and in one class a teacher uses AirPlay mirroring to send her computer to the projector, in another class a different teacher does the same but the aspect ratio is different. Its not 16:9 when the one in the first class is. I am quite sure that the projector model is the same so I am not quite sure what is going on with it.
@eytanschulman
eytanschulman / gist:832d97c286c3e9fb2590
Created September 8, 2014 09:27
WBAIS App API Request
-(void)executeCalendarRequest {
NSString *clientID = [[[GPPSignIn sharedInstance] authentication] clientID];
NSString *clientSecret = @"z4TA1SX2O9Fmf0Xr76-HASBy";
NSString *accessToken = [[[GPPSignIn sharedInstance] authentication] accessToken];
NSLog(@"clientID = %@",clientID);
NSLog(@"clientSecret = %@",clientSecret);
NSLog(@"accessToken = %@",accessToken);
@eytanschulman
eytanschulman / Check for iPhone 3.5",4",4.7" or 5.5"
Created September 13, 2014 19:02
Check for iPhone 3.5",4",4.7" or 5.5"
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
NSLog(@"Device is iPhone 4");
}
if(result.height == 568)
{
NSLog(@"Device is iPhone 5s");
@eytanschulman
eytanschulman / Open Every Website on The Useless Web as of May 16th, 2015
Last active November 1, 2016 20:45
Goto http://theuselessweb.com run this in the javascript console by typing javascript: and paste the code. At first Google Chrome will not allow popups but you can allow them. Then run again.
var sitesList = [
['http://heeeeeeeey.com/', false, 7],
['http://thatsthefinger.com/', false, 7],
['http://cant-not-tweet-this.com/', false, 7],
['http://eelslap.com/', false, 5],
['http://www.staggeringbeauty.com/', false, 7],
// ['http://www.omfgdogs.com/', false, 7], Down :(
['http://burymewithmymoney.com/', true, 7],
['http://www.fallingfalling.com/', true, 3],
['http://ducksarethebest.com/', false, 7],
@eytanschulman
eytanschulman / gist:362e4141b7e0a093174c
Created June 14, 2015 20:51
Alfred Custom Search for Apple Developer Forums
alfred://customsearch/Search%20Apple%20Documentation/appledocs/utf8/noplus/https://developer.apple.com/search/index.php?q={query}&type=Documentation