Skip to content

Instantly share code, notes, and snippets.

View alielsokary's full-sized avatar

Ali Elsokary alielsokary

View GitHub Profile
//
// SocialNetwork.swift
// SocialNetwork
//
// Created by Mohammad Farhan on 4/27/19.
// Copyright © 2019 SocialNetwork. All rights reserved.
//
import UIKit
#!/bin/bash
# Define colors & styles for outputs
# ----------------------------------
red='\033[1;31m'
green='\033[32m'
bold='\033[1m'
italic='\033[2;3m'
reset='\033[0m'
@rozd
rozd / pre-push
Last active January 18, 2021 14:28
pre-push for Swift projects
#!/bin/sh
# Prevent commits containing Tailor errors or warnings to be pushed to remote
remote="$1"
url="$2"
RED='\033[0;31m' # Red Color
NC='\033[0m' # No Color
@Davor111
Davor111 / sshuttle.sh
Created February 17, 2017 08:34
How to use sshuttle with .key, .csr or .pem files for authentication
#It's not directly mentioned in the documentation on how to do this, so here you go. This command will tunnel everything including DNS:
sshuttle --dns -vr user@yourserver.com 0/0 --ssh-cmd 'ssh -i /your/key/path.pem'
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@jplazcano87
jplazcano87 / createDoneButton.swift
Created December 28, 2015 15:13
Add Done Button to Numeric pad iOS (Swift)
@IBOutlet weak var txtNumber: UITextField!
override func viewDidLoad()
{
super.viewDidLoad()
//--- add UIToolBar on keyboard and Done button on UIToolBar ---//
self.addDoneButtonOnKeyboard()
}
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos

@staltz
staltz / introrx.md
Last active July 4, 2024 10:11
The introduction to Reactive Programming you've been missing
@andrewgleave
andrewgleave / iOSMapKitFitAnnotations.m
Last active May 17, 2024 02:07
Zooms out a MKMapView to enclose all its annotations (inc. current location)
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}