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 *cascadeList = @[[UIFontDescriptor fontDescriptorWithName:@"Helvetica" size:20.0], | |
[UIFontDescriptor fontDescriptorWithName:@"PingFangTC-Regular" size:20.0]]; | |
CTFontDescriptorRef descriptor = CTFontDescriptorCreateWithAttributes((CFDictionaryRef) @{(id)kCTFontCascadeListAttribute: cascadeList}); | |
UIFont *font = (__bridge_transfer UIFont *) CTFontCreateWithFontDescriptor(descriptor, 20, NULL); | |
CFRelease(descriptor); | |
self.label.font = font; | |
self.label.text = @"Helvetica fallback 到 PingFangTC-Regular 汉体书写信息技术标准相容档案下载使用界面简单支援服务升级资讯专业制作创意空间快速无线上网"; |
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
retinalize() { convert -density 144 -units pixelsperinch "$1" "$1" } |
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
body, | |
textarea { | |
font-family: -apple-system !important; | |
-webkit-font-smoothing: subpixel-antialiased !important; | |
} | |
pre, | |
code, | |
.line-number, | |
.blame, |
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
/* | |
Copyright (C) 2015 Apple Inc. All Rights Reserved. | |
See LICENSE.txt for this sample’s licensing information | |
Abstract: | |
The application delegate class used to manage this sample. | |
*/ | |
import UIKit | |
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
#import "UIAppearance+Swift.h" | |
@implementation UIView (UIViewAppearance_Swift) | |
+ (instancetype)swift_appearanceWhenContainedIn:(NSArray *)containerClasses | |
{ | |
NSUInteger count = containerClasses.count; | |
NSAssert(count <= 10, @"The count of containers greater than 10 is not supported."); | |
return [self appearanceWhenContainedIn: |
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
#!/usr/bin/env python | |
"""This script migrates Inboard beta library to Inboard App Store version | |
library.""" | |
import sqlite3 | |
import os | |
from os.path import expanduser | |
import subprocess | |
import shutil |
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
find . ! -path . -maxdepth 1 -type d -exec sh -c '(cd {} && pwd && git pull)' ';' |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>emoji</key> | |
<array> | |
<string>0⃣️</string> | |
</array> |
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
from timeit import timeit | |
setup = """ | |
results = [0 for _ in xrange(100)] | |
results[1] = 1 | |
results[2] = 1 | |
def fib(n): | |
if results[n]: | |
return results[n] |
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
import pygit2 | |
from pygit2 import GIT_SORT_TOPOLOGICAL, GIT_SORT_REVERSE | |
repo = pygit2.Repository("/path/to/the/repo") | |
hist_repo = pygit2.Repository("/path/to/the/repo/for/the/history") | |
parents = [] | |
for commit in repo.walk(repo.head.target, | |
GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE): | |
print "[Duplicating] " + commit.message, |
NewerOlder