Skip to content

Instantly share code, notes, and snippets.

View adel-ezzat's full-sized avatar
😎

Adel ezzat adel-ezzat

😎
View GitHub Profile
@adel-ezzat
adel-ezzat / autoV1
Last active August 22, 2020 21:19
auto popup i all user apps
#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
static void didFinishLaunching(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef info) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"WASettingsViewController" message:@"viewDidLoad"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
@adel-ezzat
adel-ezzat / gist:7e4aa8adedd82bd479235bea166e8bbc
Created April 14, 2020 11:04 — forked from snikch/gist:3661188
Find the current top view controller for your iOS application
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: content-box, border-box;
}
@adel-ezzat
adel-ezzat / media-query.css
Created June 15, 2020 20:18 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@adel-ezzat
adel-ezzat / AutoHook.h
Last active July 21, 2020 22:13 — forked from JohnCoates/AutoHook.h
Simple Objective-C Method Hooking
// https://www.reddit.com/r/jailbreakdevelopers/comments/8xb9b6/tutorial_creating_tweaks_without_logos_directly/
@protocol AutoHook <NSObject>
@required
+ (NSArray <NSString *> *)targetClasses;
@end
@adel-ezzat
adel-ezzat / UiButton+Block.
Created December 12, 2020 01:55 — forked from johnhatvani/UiButton+Block.
Objective-c runtime fun -- A UIButton that takes a block as an action. The cool thing it does is it adds this action as an instance method at runtime.
#import <objc/runtime.h>
typedef void (^buttonAction)(UIButton *sender);
@implementation UIButton (BlockAction)
+ (UIButton *) buttonWithType:(UIButtonType)type andAction:(buttonAction)action forControlEvents:(UIControlEvents)controlEvents; {
UIButton * button = [UIButton buttonWithType:type];
// suppress undeclared selector warning or else '@selector(action:)' will complain.
@adel-ezzat
adel-ezzat / gist:8fa2e9001df7f4e9810bb54b10ac7bec
Created February 11, 2021 03:22 — forked from Sunnyztj/gist:9661609
compare time in objective c
+(int)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay
{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd-MM-yyyy"];
NSString *oneDayStr = [dateFormatter stringFromDate:oneDay];
NSString *anotherDayStr = [dateFormatter stringFromDate:anotherDay];
NSDate *dateA = [dateFormatter dateFromString:oneDayStr];
NSDate *dateB = [dateFormatter dateFromString:anotherDayStr];
NSComparisonResult result = [dateA compare:dateB];
NSLog(@"date1 : %@, date2 : %@", oneDay, anotherDay);