A collection of commands that change the Arc Browser icon on macOS.
| Theme | Command |
|---|---|
| Candy Arc | defaults write company.thebrowser.Browser currentAppIconName candy |
| import Foundation | |
| import CoreFoundation | |
| public final class CoreNotificationCenter { | |
| public static let darwin = CoreNotificationCenter(CFNotificationCenterGetDarwinNotifyCenter()) | |
| public static let local = CoreNotificationCenter(CFNotificationCenterGetLocalCenter()) | |
| #if os(macOS) | |
| public static let distributed = CoreNotificationCenter(CFNotificationCenterGetDistributedCenter()) |
| #!/bin/bash | |
| # If you like this script and my work on libimobiledevice, please | |
| # consider becoming a patron at https://patreon.com/nikias - Thanks <3 | |
| REV=1.0.20 | |
| if test "`echo -e Test`" != "Test" 2>&1; then | |
| echo Please run this with zsh or bash. | |
| exit 1 |
WKWebViewConfiguration *configuration = [WKWebViewConfiguration new];
NSString *eruda = @"(function () { var script = document.createElement('script'); script.src='//cdn.jsdelivr.net/npm/eruda'; document.body.appendChild(script); script.onload = function () { eruda.init() } })();";
WKUserScript *script = [[WKUserScript alloc] initWithSource:eruda injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];
[configuration.userContentController addUserScript:script];
_webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration];or
NSString *jsPath = [[NSBundle mainBundle] pathForResource:@"vConsole" ofType:@"js"];| //回调 | |
| static void displayStatusChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { | |
| // "com.apple.springboard.lockcomplete" 通知总是接在 "com.apple.springboard.lockstate" 通知后面 | |
| CFStringRef nameCFString = (CFStringRef)name; | |
| NSString *lockState = (__bridge NSString*)nameCFString; | |
| NSLog(@"Darwin notification NAME = %@",name); | |
| if([lockState isEqualToString:@"com.apple.springboard.lockcomplete"]) { | |
| NSLog(@"锁屏"); | |
| } else { |
| NSLog(@"HostName: %@", [[NSProcessInfo processInfo] hostName]); | |
| //globallyUniqueString 唯一的标示符,每次调用都会不一样,可以用作一些临时缓存文件的名字 | |
| NSLog(@"GlobalUniqueString: %@", [[NSProcessInfo processInfo] globallyUniqueString]); | |
| //操作系统名称 | |
| NSLog(@"OperatingSystemName: %@", [[NSProcessInfo processInfo] operatingSystemName]); | |
| //操作系统版本 | |
| NSLog(@"OperatingSystemVersion: %@", [[NSProcessInfo processInfo] operatingSystemVersionString]); | |
| //物理内存 | |
| NSLog(@"PhysicalMem: %llu", [[NSProcessInfo processInfo] physicalMemory]); | |
| //进程名称 |
| - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ | |
| // maybe show an action sheet with more options | |
| [self.tableView setEditing:NO]; | |
| }]; | |
| moreAction.backgroundColor = [UIColor lightGrayColor]; | |
| UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ | |
| [self.tableView setEditing:NO]; | |
| }]; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #import "CCSprite.h" | |
| @interface SoftBubble : CCSprite | |
| @end |