Skip to content

Instantly share code, notes, and snippets.

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

Rehan Ali rehannali

🏠
Working from home
View GitHub Profile
@rehannali
rehannali / build-universal-framework.sh
Created June 25, 2021 15:40
Universal Framework depends on Cocoapods
#!/bin/sh
# Make sure to run this script in Framework folder to work properly.
# Create universal-framework.sh and copy all content to it.
# Provide FRAMEWORK_NAME to start build
# Globals Variables
# Avilable Platforms/Architectures
# macosx | iphoneos | iphonesimulator | appletvos | appletvsimulator | watchos | watchsimulator
@rehannali
rehannali / IntelIJTrialReset.bat
Last active April 8, 2021 10:46
How to Reset InteIIiJ IDEA Evaluation Key in Windows
@echo off
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%APPDATA%\JetBrains\%%I*") do (
rd /s /q "%%a/eval"
del /q "%%a\options\other.xml"
)
)
reg delete "HKEY_CURRENT_USER\SOFTWARE\JavaSoft\Prefs\jetbrains\phpstorm\edca4a4e" /f
@rehannali
rehannali / Delegation.swift
Created July 8, 2020 08:24
A simple solution for [weak self] or [unowned self] dance. No need to worry about retain cycles.
struct Delegation<Input, Output> {
private(set) var callback: ((Input) -> Output?)?
mutating func delegate<Target: AnyObject>(to target: Target, _ callback: @escaping (Target, Input) -> Output) {
self.callback = { [weak target] (input) in
guard let target = target else {
return nil
}
return callback(target, input)
}
@rehannali
rehannali / extract_categories.py
Created December 21, 2019 18:38
Get categories from Jackett index
from bs4 import BeautifulSoup
with open("/Users/rehan/Documents/iOS Projects/Developers Clan/abc.html", "r") as file:
html_doc = file.read()
categories_arr = []
html_parser = BeautifulSoup(html_doc, "lxml")
all_td_tags = html_parser.find_all("td")
@rehannali
rehannali / meld-config-sourcetree.txt
Last active August 23, 2019 10:36
Meld configuration with SourceTree
Install Meld > Add it to SystemPath where Meld.exe is located.
SourceTree > Tools > Options > Diff > Diff(Custom > Meld.exe) & Merge(Custom > Meld.exe)
Arguements:
Diff: $LOCAL $REMOTE
Merge: $LOCAL $BASE $REMOTE --auto-merge --output=$MERGED
If you got DLL Issue :
Copy "C:\Program Files (x86)\Meld\lib\libgirepository-1.0-1.dll" to "C:\Program Files (x86)\Meld\libgirepository-1.0-1.dll".