- Pastebot
- GIF Brewery
- Slack
- Keynote/Pages/Numbers
- 1Password
- OmniFocus 3
- Airmail 3
- iA Writer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UITextField { | |
/// Add a trailing placeholder label that tracks the text as it changes | |
func addTrailingPlaceholder(_ placeholder: String) { | |
let label = UILabel() | |
label.text = placeholder | |
label.alpha = 0.3 | |
label.isHidden = true | |
let container = UIView() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To compile: clang++ -arch x86_64 -arch arm64 -std=c++20 library_injector.cpp -lbsm -lEndpointSecurity -o library_injector, | |
// then codesign with com.apple.developer.endpoint-security.client and run the | |
// program as root. | |
#include <EndpointSecurity/EndpointSecurity.h> | |
#include <algorithm> | |
#include <array> | |
#include <bsm/libbsm.h> | |
#include <cstddef> | |
#include <cstdint> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Locale { | |
/// Returns an SF Symbol currency image that match's the device's current locale, for instance dollar in North America, Indian rupee in India, etc. | |
func currencySFSymbol(filled: Bool, withConfiguration configuration: UIImage.Configuration? = nil) -> UIImage { | |
// Default currency symbol will be the Animal Crossing Leaf coin to remain impartial to any specific country | |
let defaultSymbol = UIImage(systemName: "leaf.circle\(filled ? ".fill" : "")")! | |
guard let currencySymbolName = currencySymbolNameForSFSymbols() else { return defaultSymbol } | |
let systemName = "\(currencySymbolName).circle\(filled ? ".fill" : "")" | |
return UIImage(systemName: systemName, withConfiguration: configuration) ?? defaultSymbol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIAlertController { | |
/// Creates a view controller for notifying the user that a conversion is occurring. Accepts a block that is executed upon conversion completion. | |
static func createConvertingAlertController(onConversionCompletion: @escaping () -> Void) -> UIAlertController { | |
// The title font corresponds to Dynamic Type style "Headline" | |
let titleFont = UIFont.preferredFont(forTextStyle: .headline) | |
let calculatorImageView = UIImageView(image: UIImage(named: "calculator.fill", in: nil, with: UIImage.SymbolConfiguration(font: UIFont.systemFont(ofSize: titleFont.pointSize * 2.0, weight: .semibold)))) | |
let measuringAttributedStringHeight = NSAttributedString(string: "Penguin", attributes: [.font: titleFont]).boundingRect(with: .zero, options: [.usesFontLeading, .usesLineFragmentOrigin], context: nil).height | |
let desiredOffset = 15.0 + calculatorImageView.bounds.height | |
let totalNewlinePrefixes = Int((desiredOffset / measuringAttributedStringHeight). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to disable the iOS Simulator app from showing the "Do you want the application xxxx to accept incoming network connections?" pop-up every time the app is run | |
echo "> Enter password to temporarily shut firewall off" | |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off | |
echo "> Add Xcode as a firewall exception" | |
/usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/MacOS/Xcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: objective-c | |
os: osx | |
xcode_workspace: {workspace-name}.xcworkspace | |
xcode_scheme: {workspace-name} | |
xcode_sdk: iphonesimulator9.0 | |
osx_image: xcode8 | |
before_install: | |
- | | |
brew update | |
gem install xcpretty -N --no-ri --no-doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The trick is to link the DeviceSupport folder from the beta to the stable version. | |
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
# (A similar approach works for older versions too, just change the version number after DeviceSupport) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) { | |
return Observable.create(new Observable.OnSubscribe<List<String>>() { | |
@Override | |
public void call(final Subscriber<? super List<String>> subscriber) { | |
onNextObservable.subscribe(new Observer<Void>() { | |
int latestPage = -1; | |
@Override | |
public void onCompleted() { | |
subscriber.onCompleted(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2014 skyfish.jy@gmail.com | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder