Skip to content

Instantly share code, notes, and snippets.

@ArsnealX
ArsnealX / dismiss.m
Last active May 18, 2023 02:21
Dismiss captureTextFromCamera(_:)
- (void)dismissCaptureText {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
if (@available(iOS 13.0, *)) {
if (![UIScene respondsToSelector:@selector(_scenesIncludingInternal:)]) {
return;
}
NSArray *scenes = [UIScene performSelector:@selector(_scenesIncludingInternal:) withObject:@(YES)];
for (UIScene *scene in scenes) {
https://forums.developer.apple.com/message/136166#136166
https://forums.developer.apple.com/message/147579#147579
@ArsnealX
ArsnealX / appDelegate.m
Created May 27, 2017 03:44
UIDebuggingInformationOverlay
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
#if DEBUG
Class debugWindow = NSClassFromString(@"UIDebuggingInformationOverlay");
SEL selector = NSSelectorFromString(@"prepareDebuggingOverlay");
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[debugWindow performSelector:selector];
#pragma clang diagnostic pop
#endif
return YES;
@ArsnealX
ArsnealX / build.sh
Created March 29, 2017 03:19
Download & Build TurboJPEG (libjpeg-turbo) for iOS
#!/bin/bash
TARGET_NAME="libjpeg-turbo"
TARGET_VERSION="1.5.1" # change this to libjpeg-turbo version you need
IOS_SDK_VERSION=10.3 # change this to match current Xcode SDK version
IOS_SDK_MIN_VERSION=8.0
IOS_PLATFORM_BASE="/Applications/Xcode.app/Contents/Developer/Platforms"
cd `dirname $0`
@ArsnealX
ArsnealX / jail.local
Last active March 3, 2017 06:07
fail2ban jail local config
[DEFAULT]
bantime = 86400
banaction = firewallcmd-ipset
backend = systemd
ignoreip = 127.0.0.1
findtime = 3600
maxretry = 3
[sshd]
enabled = true
http://vps.sakura.ad.jp
https://www.starrydns.com
http://digitalswift.net
https://www.serverzoo.com
equire 'ttfunk'
file = TTFunk::File.open("/path/to/fontfile.ttf")
cmap = file.cmap
chars = {}
unicode_chars = []
cmap.tables.each do |subtable|
next if !subtable.unicode?
# requirement:
# brew install sox
mkdir wavmono
# convert to mono
for i in *.wav; do
sox "$i" "./wavmono/$i" remix 1
done
@ArsnealX
ArsnealX / ViewControllerCodeSnippet.m
Created February 5, 2016 07:35
View Controller Code Snippets
#import "YourViewControllerName.h"
@implementation YourViewControllerName
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
[self loadDataSource];
[self loadUIComponents];
}