Skip to content

Instantly share code, notes, and snippets.

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

Asad Ali asadali737

🏠
Working from home
View GitHub Profile
@azu
azu / README.md
Created June 6, 2021 07:13
Decrypt and restore iOS backup(`Manifest.db` is encrypted) for restoring my iOS photos.

Setup

Use https://github.com/jfarley248/iTunes_Backup_Reader

git clone https://github.com/jfarley248/iTunes_Backup_Reader
cd iTunes_Backup_Reader
# apply https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
gh pr checkout https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
@anitaa1990
anitaa1990 / CurvedUIView.swift
Last active May 18, 2022 16:22
A Swift extension of UIView to display a curved view
import UIKit
extension UIView {
/* Usage Example
* bgView.addBottomRoundedEdge(desiredCurve: 1.5)
*/
func addBottomRoundedEdge(desiredCurve: CGFloat?) {
@grimzy
grimzy / git-pull-all
Created September 15, 2017 02:15
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@nyg
nyg / MemoryAddress.swift
Last active June 26, 2024 16:44
Get the memory address of both class and structure instances in Swift.
// https://stackoverflow.com/a/45777692/5536516
import Foundation
struct MemoryAddress<T>: CustomStringConvertible {
let intValue: Int
var description: String {
let length = 2 + 2 * MemoryLayout<UnsafeRawPointer>.size
@seanhenry
seanhenry / resign.sh
Last active April 24, 2024 09:14
Resign an ipa and change the build number
APPNAME=App
BUILDNUMBER=123
CERTIFICATE="iPhone Distribution"
cp "${APPNAME}.ipa" "${APPNAME}.zip"
mkdir contents || true
unzip "${APPNAME}.zip" -d contents
codesign -d --entitlements :Entitlements.plist "contents/Payload/${APPNAME}.app"
plutil -replace CFBundleVersion -string "${BUILDNUMBER}" "contents/Payload/${APPNAME}.app/Info.plist"
rm -r "contents/Payload/${APPNAME}.app/_CodeSignature"
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
private var array = [Element]()
public init() { }
@shaps80
shaps80 / cURL+Request.swift
Last active December 23, 2023 17:43
Generates a cURL command representation of a URLRequest in Swift.
import Foundation
extension URLRequest {
/**
Returns a cURL command representation of this URL request.
*/
public var curlString: String {
guard let url = url else { return "" }
var baseCommand = #"curl "\#(url.absoluteString)""#
@tadija
tadija / FontNames-iOS-17.4.swift
Last active May 31, 2024 19:23
iOS - All Font Names
/*
*** Academy Engraved LET ***
AcademyEngravedLetPlain
---------------------
*** Al Nile ***
AlNile
AlNile-Bold
---------------------
*** American Typewriter ***
AmericanTypewriter
@pocketkk
pocketkk / gist:e449cc89d40ce9744590
Created July 13, 2014 15:01
Swift - Add subview with transition
UIView.transitionWithView(self.view, duration: 0.5, options: UIViewAnimationOptions.TransitionNone,
animations: {self.view.addSubview(effectView)}, completion: nil)