$ brew install pdnsd
$ sudo chown -R nobody /usr/local/var/cache/pdnsd
$ curl -L http://goo.gl/kMlyQ -o pdnsd.conf
$ mv pdnsd.conf /usr/local/etc
$ sudo chown root /usr/local/etc/pdnsd.conf
This file contains hidden or 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 Foundation | |
func associatedObject<ValueType: AnyObject>( | |
base: AnyObject, | |
key: UnsafePointer<UInt8>, | |
initialiser: () -> ValueType) | |
-> ValueType { | |
if let associated = objc_getAssociatedObject(base, key) | |
as? ValueType { return associated } | |
let associated = initialiser() |
This file contains hidden or 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. | |
typealias NotifiableExecuteBlock = (Notification) -> Void | |
protocol Notifiable { | |
var name: Notification.Name { get } | |
func observe(by observer: Any, withSelector selector: Selector, object: Any?) | |
func observe(with object: Any?, using block: @escaping NotifiableExecuteBlock) |
This file contains hidden or 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
# Modern secure (OpenSSH Server 7+) SSHd config by HacKan | |
# Refer to the manual for more info: https://www.freebsd.org/cgi/man.cgi?sshd_config(5) | |
# Server fingerprint | |
# Regenerate with: ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa -b 4096 | |
HostKey /etc/ssh/ssh_host_rsa_key | |
# Regerate with: ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519 | |
HostKey /etc/ssh/ssh_host_ed25519_key | |
# Log for audit, even users' key fingerprint |
This file contains hidden or 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 | |
# | |
# 通过对比 ping 响应时间,找到本机最快的上传ip | |
# [email protected] | |
# | |
# 使用方法: | |
# sh -c "$(curl -sSL https://gist.githubusercontent.com/trawor/5dda140dee86836b8e60/raw/turbo-qiniu.sh)" | |
echo "# 这个脚本理论上可以帮你获取任意域名的最快速的IP" | |
echo "# 获取IP列表的服务由 17ce.com 提供, 非常感谢有这么好的免费服务!" |
This file contains hidden or 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
# A.BIG.T rule config | |
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备 | |
# Version 2.0 | |
[General] | |
# 日志等级: error,warning, notify, info, verbose (默认值: info) | |
loglevel = info | |
# 跳过某个域名或者 IP 段,这些目标主机将不会由 A.BIG.T 处理。 | |
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local | |
# 强制使用特定的 DNS 服务器 |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
#weasel.custom.yaml | |
patch: | |
"preset_color_schemes/Solarized_Lite": | |
author: "五磅兔 [email protected], based on Aben's 曬經石\solarized_Rock, original artwork by ethanschoonover‘s solarized" | |
back_color: 0xe3f6fd #底色 | |
border_color: 0xd5e8ee #边框色 | |
candidate_text_color: 0x837b65 #候选项颜色 | |
comment_text_color: 0xd28b26 #编码提示颜色 | |
hilited_back_color: 0xd5e8ee #编码底色 | |
hilited_candidate_back_color: 0x98a12a #首选项高亮背景色 |