Skip to content

Instantly share code, notes, and snippets.

View dabing1022's full-sized avatar
👨‍💻
Focusing

ChildhoodAndy dabing1022

👨‍💻
Focusing
View GitHub Profile
@syh19
syh19 / cherry-studio-prompt-sidebar.css
Created July 25, 2025 01:18
Cherry Studio 左侧助手栏自定义样式
/* CSS变量定义 */
.TagsContainer-erHQJu:nth-child(1) { --group-color: 59, 130, 246; }
.TagsContainer-erHQJu:nth-child(2) { --group-color: 34, 197, 94; }
.TagsContainer-erHQJu:nth-child(3) { --group-color: 168, 85, 247; }
.TagsContainer-erHQJu:nth-child(4) { --group-color: 249, 115, 22; }
.TagsContainer-erHQJu:nth-child(5) { --group-color: 239, 68, 68; }
.TagsContainer-erHQJu:nth-child(6) { --group-color: 6, 182, 212; }
.TagsContainer-erHQJu:nth-child(7) { --group-color: 245, 158, 11; }
.TagsContainer-erHQJu:nth-child(8) { --group-color: 156, 163, 175; }
.TagsContainer-erHQJu:nth-child(9) { --group-color: 219, 39, 119; }
@gabe565
gabe565 / change-arc-icon.md
Last active May 26, 2025 02:32
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon on macOS.

Commands

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())
@nikias
nikias / limd-build-macos.sh
Last active July 2, 2025 22:38
Build libimobiledevice stack for macOS with ease
#!/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.19
if test "`echo -e Test`" != "Test" 2>&1; then
echo Please run this with zsh or bash.
exit 1
@zhaozzq
zhaozzq / inject.markdown
Last active October 16, 2024 01:41
Inject js to WKWebView
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"];
@junyixin
junyixin / lock.m
Last active October 13, 2023 10:12
iOS锁屏通知(Objective-C)
//回调
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 {
@dabing1022
dabing1022 / GetDeviceInfo.mm
Last active May 22, 2022 06:57
IOS_GET_DEVICE_INFO
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];
}];
@staltz
staltz / introrx.md
Last active August 10, 2025 21:23
The introduction to Reactive Programming you've been missing
#import "CCSprite.h"
@interface SoftBubble : CCSprite
@end