This repo's location has changed.
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
// TextView subclass that replicates TVOS movies app | |
// Also made a quick presentation controller | |
// Just connect the delegate to the ViewController in IB | |
// and set the TextView class to FocusTextView | |
import UIKit | |
class TextPresentationViewController:UIViewController { | |
let label = UILabel() | |
let blurStyle = UIBlurEffectStyle.Dark |
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
#!/bin/sh | |
# | |
# install_xcode.sh | |
# | |
# Created by Andrew McKnight on 9/24/15 | |
# | |
# takes a downloaded .dmg containing Xcode and installs it to a specified location/name, or defaults to /Applications and the DMG's filename | |
# |
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
// This is a coding exercise of implementing a parser. Some minor parsing capabilities are not implemented. | |
// The algorithm are mainly from Douglas Crockford's 'https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js' | |
function json_parse(str) { | |
var i = 0 | |
var ch = str[i] | |
// core function that recursively called to move forward scanning pointers and accept tokens | |
function next(c) { | |
if (c) { |
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
#!/bin/sh | |
if [ $1 = 0000000000000000000000000000000000000000 ]; then | |
old=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
else | |
old=$1 | |
fi | |
if [ -f Podfile ] && command -v pod install >/dev/null && | |
git diff --name-only $old $2 | egrep -q '^Podfile$' | |
then | |
(unset GIT_DIR; exec pod install) | grep -v '^Using ' | grep -v ' is complete' |
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
#!/bin/bash | |
# -------------------------------------------------------------- | |
# iOSOpenDev -- iOS Open Development (http://www.iOSOpenDev.com) | |
# Copyright (C) 2012 Spencer W.S. James <dev@iosopendev.com> | |
# -------------------------------------------------------------- | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. |
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
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"> | |
<html> | |
<head> | |
<title>${project.name}</title> | |
<style> | |
body table, td, th, p, h1, h2 { | |
margin:0; | |
font:normal normal | |
100% Georgia, Serif; | |
background-color: #ffffff; |
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
source ~/.bash_profile | |
cd ${SRCROOT} | |
xcodebuild clean | |
xcodebuild | xcpretty -r json-compilation-database | |
oclint-json-compilation-database -- -report-type xcode |
在 Web 上应用字体是一项基本技术,同时也是一门艺术。对于英文字体来说可选择的范围实在是太广泛了,合理的使用它们将会为你的网站增色不少。关于英文字体的使用和搭配技巧,在这里不做赘述,只推荐一套非常好的视频:Fundamentals of Design by CodeSchool
而真正的挑战在于中文字体,由于中文字体组成的特殊性导致其体积过于庞大,除了操作系统内置的字体之外,我们很难在网站上应用其他的字体。在可选性很差的前提之下,如何正确的使用中文字体呢?
首先,以下的字体声明都是很糟糕的,切忌使用:
font-family: "宋体";
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
// See http://www.bluejava.com/4NS/Speed-up-your-Websites-with-a-Faster-setTimeout-using-soon | |
// This is a very fast "asynchronous" flow control - i.e. it yields the thread and executes later, | |
// but not much later. It is far faster and lighter than using setTimeout(fn,0) for yielding threads. | |
// Its also faster than other setImmediate shims, as it uses Mutation Observer and "mainlines" successive | |
// calls internally. | |
// WARNING: This does not yield to the browser UI loop, so by using this repeatedly | |
// you can starve the UI and be unresponsive to the user. | |
// Note: For an even faster version, see https://gist.github.com/bluejava/b3eb39911da03a740727 | |
var soon = (function() { | |