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
AccessModifierOffset: -4 | |
AlignEscapedNewlinesLeft: true | |
AlignTrailingComments: false | |
AllowAllParametersOfDeclarationOnNextLine: false | |
AllowShortBlocksOnASingleLine: false | |
AllowShortFunctionsOnASingleLine: None | |
AllowShortIfStatementsOnASingleLine: false | |
AllowShortLoopsOnASingleLine: false | |
AlwaysBreakBeforeMultilineStrings: false | |
AlwaysBreakTemplateDeclarations: false |
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
#ifdef NSTextAlignmentCenter | |
#define BLTextAlignmentCenter NSTextAlignmentCenter | |
#define BLTextAlignmentLeft NSTextAlignmentLeft | |
#define BLTextAlignmentRight NSTextAlignmentRight | |
#define BLTextTruncationTail NSLineBreakByTruncatingTail | |
#define BLTextTruncationMiddle NSLineBreakByTruncatingMiddle | |
#else | |
#define BLTextAlignmentCenter UITextAlignmentCenter | |
#define BLTextAlignmentLeft UITextAlignmentLeft | |
#define BLTextAlignmentRight UITextAlignmentRight |
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
//hide dock icon | |
ProcessSerialNumber psn = { 0, kCurrentProcess }; | |
TransformProcessType(&psn, kProcessTransformToUIElementApplication); | |
//show dock icon | |
ProcessSerialNumber psn = { 0, kCurrentProcess }; | |
TransformProcessType(&psn, kProcessTransformToForegroundApplication); |
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
// | |
// NSImage+Blur.h | |
// BlurView | |
// | |
// Created by 61 on 13-11-19. | |
// Copyright (c) 2013年 61. All rights reserved. | |
// | |
#import <Cocoa/Cocoa.h> |
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
// | |
// NSImage+ScreenShot.h | |
// YunPan for Mac | |
// | |
// Created by 61 on 13-11-25. | |
// | |
// | |
#import <Cocoa/Cocoa.h> |
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
git filter-branch --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ]; then | |
[email protected]; | |
GIT_AUTHOR_NAME="chenyuan.ly"; | |
GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL; | |
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; fi' -- --all |
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
NSArray *filesArray = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath:cachePath error:&error]; | |
NSEnumerator *filesEnumerator = [filesArray objectEnumerator]; | |
NSString *fileName; | |
unsigned long long int fileSize = 0; | |
while (fileName = [filesEnumerator nextObject]) { | |
NSString *filePath = [cachePath stringByAppendingPathComponent:fileName]; | |
NSDictionary *fileDictionary = [fm attributesOfItemAtPath:filePath error:&error]; | |
fileSize += [fileDictionary fileSize]; | |
} |
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
on GetCurrentApp() | |
tell application "System Events" | |
set _app to item 1 of (every process whose frontmost is true) | |
return name of _app | |
end tell | |
end GetCurrentApp | |
set _app to GetCurrentApp() |
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
/* Get the localized name of a display, given the display ID. */ | |
-(NSString *)displayNameFromDisplayID:(CGDirectDisplayID)displayID | |
{ | |
NSString *displayProductName = nil; | |
/* Get a CFDictionary with a key for the preferred name of the display. */ | |
NSDictionary *displayInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName); | |
/* Retrieve the display product name. */ | |
NSDictionary *localizedNames = [displayInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]]; | |
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
// | |
// AppDelegate.m | |
// demo | |
// | |
// Created by 61 on 13-8-11. | |
// Copyright (c) 2013年 61. All rights reserved. | |
// | |
#import "AppDelegate.h" | |
#import <IOKit/IOKitLib.h> |
NewerOlder