Skip to content

Instantly share code, notes, and snippets.

View dwirandyh's full-sized avatar
🎯
Focusing

Dwi Randy Herdinanto dwirandyh

🎯
Focusing
View GitHub Profile
@MarcoEidinger
MarcoEidinger / findRequiredReasonAPIUsage.sh
Created August 21, 2023 19:55
A shell script to find if any "required reason API" are used in Swift or Objective-C files within that folder or subfolders
#!/bin/bash
# https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api
searchTerms=(
# File timestamp APIs
"creationDate"
"modificationDate"
"fileModificationDate"
"contentModificationDateKey"
"creationDateKey"
@ksmandersen
ksmandersen / PaddedTextField.swift
Last active March 27, 2023 03:33
Best way to inset text inside a UITextField
import UIKit
open class PaddedTextField: UITextField {
public var textInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) {
didSet { setNeedsDisplay() }
}
public override init(frame: CGRect) {
super.init(frame: frame)
}
@VladaHejda
VladaHejda / realpathi.php
Last active July 3, 2018 03:55
PHP case-insensitive realpath()
<?php
/**
* Case-insensitive realpath()
* @param string $path
* @return string|false
*/
function realpathi($path)
{
$me = __METHOD__;