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
###################### | |
# Create log file | |
###################### | |
exec > ~/Desktop/tmp/UniversalBuild_Log_$(date +"%Y%m%d%H%M%S").log 2>&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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
server_name <YOUR_PUBLIC_IP>; | |
root "/var/www/${PROJECT_ROOT}"; | |
index index.html index.htm index.php; | |
charset utf-8; |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
// This is for dmoe, you can use a generice type to limit your observer to an UIViewController for common usage. | |
protocol Notifiable { | |
var name: Notification.Name { get } | |
func observe(by observer: Any, withSelector selector: Selector, object: Any?) | |
func post(object: Any? ,userInfo: [AnyHashable: Any]?) | |
static func remove(observer: Any) |
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 trick is orininally from 'https://boxueio.com/' | |
infix operator !! | |
func !!<T>(optional: T?, errorMessage: @autoclosure () -> String) -> T { | |
if let value = optional { return value } | |
fatalError(errorMessage) | |
} | |
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 implementation is originally from `https://boxueio.com` | |
typealias Criterial<T> = (T, T) -> Bool | |
func insertionSortOf<T: Comparable>(_ coll: [T], byCriteria: Criterial<T> = { $0 < $1 }) -> [T] { | |
guard coll.count > 1 else { | |
return coll | |
} | |
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
#include <SPI.h> | |
#include <Ethernet.h> | |
// Any MAC that won't conflice with any device in your network will do | |
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDe, 0x02 }; | |
EthernetClient client; | |
void setup() { | |
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
set nocompatible | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set hlsearch | |
set incsearch | |
set guioptions-=e |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>The HTML5 Herald</title> | |
<meta name="description" content="The HTML5 Herald"> | |
<meta name="author" content="SitePoint"> |
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
class Solution { | |
func ladderLength(_ beginWord: String, _ endWord: String, _ wordList: [String]) -> Int { | |
var wordSet: Set<String> = Set(wordList) | |
guard wordSet.contains(endWord) else { | |
return 0 | |
} | |
// Lookup table for neighbors |
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
ACTION = build | |
AD_HOC_CODE_SIGNING_ALLOWED = NO | |
ALTERNATE_GROUP = staff | |
ALTERNATE_MODE = u+w,go-w,a+rX | |
ALTERNATE_OWNER = grantdavis | |
ALWAYS_SEARCH_USER_PATHS = NO | |
ALWAYS_USE_SEPARATE_HEADERMAPS = YES | |
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer | |
APPLE_INTERNAL_DIR = /AppleInternal | |
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation |