Skip to content

Instantly share code, notes, and snippets.

Mohamed Saleh Zaied engmsaleh

Block or report user

Report or block engmsaleh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View K8S Cheatsheet
kubectl get services # List all services
kubectl get pods # List all pods
kubectl get nodes -w # Watch nodes continuously
kubectl version # Get version information
kubectl cluster-info # Get cluster information
kubectl config view # Get the configuration
kubectl describe node <node> # Output information about a node
kubectl get pods # List the current pods
kubectl describe pod <name> # Describe pod <name>
kubectl get rc # List the replication controllers
engmsaleh /
Last active Oct 6, 2018 — forked from cecilemuller/
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)

Virtual hosts

Let's say you want to host domains and

Create folders for their files:

engmsaleh / gist:f40c644becf7d8bc5a465152f6460080
Created Apr 15, 2017
Add new IAM user profile to AWS CLI
View gist:f40c644becf7d8bc5a465152f6460080
$ aws configure --profile account1
// To use the profile
$ aws s3 ls --profile account2
// To set the default profile
$ export AWS_DEFAULT_PROFILE=account1
engmsaleh / UIButton+VerticalLayout.h
Created Jan 1, 2016 — forked from r3econ/UIButton+VerticalLayout.h
UIButton category for centering title label and image vertically. The text label is placed below the image.
View UIButton+VerticalLayout.h
@interface UIButton (VerticalLayout)
- (void)centerVerticallyWithPadding:(float)padding;
- (void)centerVertically;
engmsaleh / CEButton.h
Created Jan 1, 2016 — forked from oliverdowling/CEButton.h
A custom UIButton extension that can change title and image insets depending on button state.
View CEButton.h
// CEButton.h
// Created by Cemal Eker on 11/12/13. (2013-11-12)
// Mofidied by Oliver Dowling on 2014-04-28.
#import <UIKit/UIKit.h>
@interface CEButton : UIButton
engmsaleh / gist:3568f97acda9910683cc
Created Dec 23, 2015
Make UIToolBar transparent
View gist:3568f97acda9910683cc
if ([self.shareFooterToolBar respondsToSelector:@selector(setBackgroundImage:forToolbarPosition:barMetrics:)]) {
[self.shareFooterToolBar setBackgroundImage:[UIImage new] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
if ([self.shareFooterToolBar respondsToSelector:@selector(setShadowImage:forToolbarPosition:)]) {
[self.shareFooterToolBar setShadowImage:[UIImage new] forToolbarPosition:UIToolbarPositionAny];
engmsaleh / gist:ede0a358dcdd3c209497
Last active Dec 23, 2015
Apply tint color on UIImage inside UIImageView
View gist:ede0a358dcdd3c209497
// Source
// init the image using imageWithRenderingMode set to AlwaysTemplate
UIImage *image = [[UIImage imageNamed:@"checkmark"]
// put UIImage in a UIImageView and adjust color with tintColor
UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
imageView.tintColor = [UIColor redColor];
engmsaleh /
Created Nov 16, 2015 — forked from mattt/
A list of methods and properties conforming to `UIAppearance` as of iOS 8.0

Generate the list yourself:

$ cd /Applications/*.sdk/System/Library/Frameworks/UIKit.framework/Headers


View Print in debugger the indexpath.row
expr (void)NSLog(@"indexPath row: %ld", (long int)[indexPath row])
engmsaleh / gist:6fa1f2ac1e572631cde4
Created Nov 13, 2015
Add Text on UIImage and return new UIImage
View gist:6fa1f2ac1e572631cde4
- (UIImage*)image:(UIImage*)image withText:(NSString*)text
CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
[image drawInRect:rect];
/// Make a copy of the default paragraph style
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
/// Set line break mode
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
You can’t perform that action at this time.