ℹ️ This article is also available on his blog.
Layout and Drawing are two different things:
- Layout defines only the positions and sizes of all views on screen.
- Drawing specifies how each view is rendered (how it looks).
// https://www.swiftjectivec.com/calling-private-ios-apis-using-nsinvocation/ | |
- (void)viewDidAppear:(BOOL)animated { | |
[super viewDidAppear:animated]; | |
// Load in the private framework | |
[[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/TipKit.framework"] load]; | |
// Get our class type | |
Class TPKContentView = NSClassFromString(@"TPKContentView"); |
#!/bin/sh | |
if [[ $# < 2 ]]; then | |
echo "Use password saved in macOS keychain for Cisco VPNs" | |
echo "$0 usage: myscript vpnname keychainitem [close_second_window]" | |
exit 1 | |
fi | |
VPNName=$1 # match the name of the VPN service to run | |
keychainItem=$2 # this name has to match "Account" for the entry you make in keychain | |
password=$(security find-generic-password -wl "$keychainItem") |
# 1. Check for any local time machine snapshots | |
tmutil listlocalsnapshots / | |
# 2. Ask time machine to free 100 GBs of local snapshots. Third parameter '1' probably means high priority (found that somewhere on the internet) | |
tmutil thinlocalsnapshots / 100000000000 1 | |
# 3. Make sure that only a `(dataless)` snapshot exists | |
tmutil listlocalsnapshots / | |
# 4. List all mounted volumes and find the one mounted on '/' (probably '/dev/disk1s1') |
ℹ️ This article is also available on his blog.
Layout and Drawing are two different things:
# https://medium.com/revenuecat-blog/dissecting-an-app-store-receipt-b1e9c5136482 | |
# Load the contents of the receipt file | |
receipt_file = open('./receipt_data.bin', 'rb').read() | |
# Use asn1crypto's cms definitions to parse the PKCS#7 format | |
from asn1crypto.cms import ContentInfo | |
pkcs_container = ContentInfo.load(receipt_file) | |
# Extract the certificates, signature, and receipt_data |
[Leyes fundamentales del desarrollo software] (https://ingenieriadesoftware.es/leyes-fundamentales-desarrollo-software/)
Añadir personal a un proyecto que va tarde, sólo consigue que se retrase aún más.
Las organizaciones acaban diseñado sistemas que son un reflejo de su propia estructura organizativa interna
# https://rambo.codes/ios/quick-tip/2019/12/09/clearing-your-apps-launch-screen-cache-on-ios.html | |
import UIKit | |
public extension UIApplication { | |
func clearLaunchScreenCache() { | |
do { | |
try FileManager.default.removeItem(atPath: NSHomeDirectory()+"/Library/SplashBoard") | |
} catch { | |
print("Failed to delete launch screen cache: \(error)") |
If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).
You can do this in recent versions of Xcode by setting a configuration default.
From a terminal, just type this command and press Enter:
defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View" "Presenter" "Wireframe"
#!/usr/bin/env bash | |
# Fetch the password from the keychain if it exists | |
PASSWORD_ENTERED=false | |
ACCOUNT_NAME='login' | |
SERVICE_NAME='mount_volume' | |
PASSWORD=$( | |
security 2> /dev/null \ | |
find-generic-password -w \ | |
-a $ACCOUNT_NAME \ |