Skip to content

Instantly share code, notes, and snippets.

View msabukwaik's full-sized avatar
🏠
Working from home

Mohammed Safwat Abu Kwaik msabukwaik

🏠
Working from home
View GitHub Profile
@msabukwaik
msabukwaik / Instructions.sh
Created April 27, 2018 21:27 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@msabukwaik
msabukwaik / importantSwift.swift
Created December 21, 2017 18:36
important swift
// List all envs
let env = ProcessInfo.processInfo.environment
print(env)
// List all args
let arg = ProcessInfo.processInfo.arguments
print(arg)
@msabukwaik
msabukwaik / SwiftClassesExtensions.swift
Last active December 21, 2017 18:23
Swift classes extensions
//Extensions for swift classes
@msabukwaik
msabukwaik / .zshrc
Created December 13, 2017 20:08
.zshrc
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH:/usr/local/sbin:$PATH:~/.composer/vendor/bin
# Path to your oh-my-zsh installation.
export ZSH=/Users/msabukwaik/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="robbyrussell"
@msabukwaik
msabukwaik / Careem.swift
Last active January 24, 2024 10:53
Careem
// MARK : function definition without binarytree, the problem of this solution is that the big-O of this algorithm is O(n^2)
// Write a function named firstNonRepeatingLetter that takes a string input, and returns the first character that is not repeated anywhere in the string.
func firstNonRepeatingLetter(_ inputString:String) -> Character?{
// Convert to lowercase
let inputStringLower = inputString.lowercased()
//Iterate each character in a given string
for i in 0..<inputString.count{
//Compare with the other characters of the string
@msabukwaik
msabukwaik / Podfile
Last active February 13, 2018 22:56
Podfile
use_frameworks!
platform :ios, '9.0'
def shared_pods
# Firebase
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
@msabukwaik
msabukwaik / UITableView+Ext.swift
Created November 22, 2017 09:34
UITableView+Ext
import UIKit
extension IndexPath {
static func fromRow(_ row: Int) -> IndexPath {
return IndexPath(row: row, section: 0)
}
}
extension UITableView {
func applyChanges(section: Int = 0, deletions: [Int], insertions: [Int], updates: [Int]) {
@msabukwaik
msabukwaik / URL+Ext.swift
Last active November 22, 2017 09:32
URL+Ext
import UIKit
extension URL {
// returns an absolute URL to the desired file in documents folder
static func inDocumentsFolder(fileName: String) -> URL {
return URL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0], isDirectory: true)
.appendingPathComponent(fileName)
}
}
@msabukwaik
msabukwaik / cocapod.txt
Last active November 22, 2017 10:09
Clear CocoaPods
rm -rf ~/Library/Caches/CocoaPods;
rm -fr ~/.cocoapods/repos/master/;
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf Pods/
pod install
@msabukwaik
msabukwaik / .gitignore
Last active November 22, 2017 09:32
.gitignore iOS development
# Mac
.DS_Store
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/