创建一个新书签,将以下内容作为书签的 url:
javascript:(()=> { const ns = prompt('namespace and/or class (e.g. system.net.http)'); ns && (window.location=`https://docs.microsoft.com/en-us/dotnet/api/${ns}?view=net-5.0`)})()
(setq cxa/font-pairs | |
'((default | |
:heading (:family "TheFutureFZYouHei" :weight bold :slant normal) | |
:body (:family "WCaslonZZMC" :height 270) | |
:code (:family "PitchFZ" :height 200)) | |
(brill | |
:heading (:family "TheFutureFZYouHei" :weight bold :slant normal) | |
:body (:family "Brill" :height 270) | |
:code (:family "PitchSansOPPO" :height 200)) | |
(questa |
#!/usr/bin/env node | |
// npm i -g @mozilla/readability puppeteer | |
const puppeteer = require("puppeteer"); | |
const fs = require("fs"); | |
const readabilityJsStr = fs.readFileSync( | |
require.resolve("@mozilla/readability/Readability.js"), | |
{ encoding: "utf-8" } | |
); |
let regex; | |
/* 匹配特定的字符串 */ | |
regex = /hello/; // 查找斜杠中的字符串(大小写敏感)……匹配 "hello", "hello123", "123hello123", "123hello",但不匹配 "hell0", "Hello" | |
regex = /hello/i; // 查找斜杠中的字符串(大小写不敏感)……匹配 "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // 全局查找斜杠中的字符串…… | |
/* 通配符 */ | |
regex = /h.llo/; // "." 匹配除了换行外的任何一个字符……匹配 "hello", "hallo",但不匹配 "h\nllo" | |
regex = /h.*llo/; // "*" 匹配任何字符零次或多次,如 "hello", "heeeeeello", "hllo", "hwarwareallo" |
- (void)drawRect:(NSRect)rect | |
{ | |
// Drawing code here. | |
CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; | |
CGContextSetTextMatrix(context, CGAffineTransformIdentity); | |
NSAttributedString *str = [[NSAttributedString alloc ] | |
initWithString:@"学习 Core Text. Learning Core Text. 中华人民共和国。" | |
attributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"Adobe Song Std" size:24.0f], (NSString *)kCTFontAttributeName, [NSNumber numberWithBool:YES], (NSString *)kCTVerticalFormsAttributeName, nil]]; | |
CFAttributedStringRef attrString = (CFAttributedStringRef)str; | |
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(attrString); |
创建一个新书签,将以下内容作为书签的 url:
javascript:(()=> { const ns = prompt('namespace and/or class (e.g. system.net.http)'); ns && (window.location=`https://docs.microsoft.com/en-us/dotnet/api/${ns}?view=net-5.0`)})()
#import <ApplicationServices/ApplicationServices.h> | |
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) | |
{ | |
if (argc != 2) | |
return 0; | |
NSAutoreleasePool *pool = [NSAutoreleasePool new]; | |
CFStringRef name = (CFStringRef) [NSString stringWithUTF8String: argv[1]]; |
Process: Xcode [79975] | |
Path: /Applications/Xcode.app/Contents/MacOS/Xcode | |
Identifier: Xcode | |
Version: 9.0 (13247) | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: Xcode [79975] | |
User ID: 501 | |
Date/Time: 2017-09-14 20:28:22.458 +0800 |
if ( rawEnabled && self.photoOutput.availableRawPhotoPixelFormatTypes.count ) { | |
//photoSettings = [[AVCapturePhotoBracketSettings alloc] initWithFormat:nil rawPixelFormatType:(OSType)(((NSNumber *)self.photoOutput.availableRawPhotoPixelFormatTypes[0]).unsignedLongValue) bracketedSettings:bracketedSettings]; | |
photoSettings = [AVCapturePhotoBracketSettings photoBracketSettingsWithRawPixelFormatType:(OSType)(((NSNumber *)self.photoOutput.availableRawPhotoPixelFormatTypes[0]).unsignedLongValue) processedFormat:nil bracketedSettings:bracketedSettings]; | |
} | |
else { | |
//photoSettings = [[AVCapturePhotoBracketSettings alloc] initWithFormat:@{ AVVideoCodecKey : AVVideoCodecJPEG } rawPixelFormatType:0 bracketedSettings:bracketedSettings]; | |
photoSettings = [AVCapturePhotoBracketSettings photoBracketSettingsWithRawPixelFormatType:0 processedFormat:@{ AVVideoCodecKey : AVVideoCodecJPEG } bracketedSettings:bracketedSettings]; | |
} |
#ifdef __OBJC__ | |
#import <Foundation/Foundation.h> | |
#define BUNDLE_NAME CXAFileManagerResourceBundle | |
extern NSBundle *BUNDLE_NAME; | |
#undef NSLocalizedString | |
#define NSLocalizedString(key, comment) [BUNDLE_NAME localizedStringForKey:(key) value:@"" table:nil] | |
#ifdef COMPILE_ONCE |
int fiddle = open("DOCUMENT_DIRECTORY", O_EVTONLY); | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VNODE, fiddle, DISPATCH_VNODE_WRITE, queue); | |
dispatch_source_set_event_handler(source, ^{ | |
// how to determine if a file has finished copying? | |
}); |