- 角色
- 發佈
- 週邊(peripheral)
- 廣播(broadcast)
- 中心(central)
- 掃瞄(scan)
- 週邊(peripheral)
- 連線
- server
- client
- 發佈
- 搭配
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
| extension StringTransform { | |
| public static let 简 = StringTransform("Hant-Hans") | |
| public static let 繁 = StringTransform("Hans-Hant") | |
| public static let 拼 = StringTransform("Han-Latin") | |
| public static let 注 = StringTransform("Han-Latin;Latin-Bopomofo") | |
| } | |
| let 繁转简 = "繁轉簡".applyingTransform(.简, reverse: false) | |
| let 簡轉繁 = "简转繁".applyingTransform(.繁, reverse: false) | |
| let pīnyīn = "拼音".applyingTransform(.拼, reverse: false) |
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
| const { createStore, bindActionCreators } = Redux | |
| const reducer = (state = {紅:0, 綠:0, 藍:0}, action) => { | |
| switch (action.type){ | |
| case '紅': return {...state, 紅:action.值} | |
| case '綠': return {...state, 綠:action.值} | |
| case '藍': return {...state, 藍:action.值} | |
| default: return state | |
| } | |
| } |
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 | |
| import Cocoa | |
| func text2bitmap(text: String, font: NSFont) -> [[Bool]]? { | |
| let attributes = [NSAttributedStringKey.font:font] | |
| let size = text.size(withAttributes: attributes) | |
| let width = Int(size.width) | |
| let height = Int(size.height) | |
| let bytesPerRow = width |
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
| // store: 一個app state的集合體,以object表示 | |
| // 換句話說,store是由許多state組成 | |
| // 先規劃 store,初始值如下 | |
| // { | |
| // 原料: ["咖啡"], | |
| // 顏色: { | |
| // 紅: 111, | |
| // 綠: 78, | |
| // 藍: 55, | |
| // } |
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
| const CardList = (props) => { | |
| let snapScroll, lastx, scrollingRight | |
| const scrollBack = () => { | |
| const len = props.cards.length | |
| if (len == 0 || lastx==undefined) { | |
| return | |
| } | |
| let index = scrollingRight? Math.ceil(lastx / cardWith) : Math.floor(lastx / cardWith) | |
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
| extension NSString:UIActivityItemSource { | |
| public func activityViewControllerPlaceholderItem(_ activityViewController: UIActivityViewController) -> Any { | |
| return "" | |
| } | |
| public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivityType) -> Any? { | |
| let installedFB = UIApplication.shared.canOpenURL(URL(string: "fb://")!) | |
| let isFB = activityType == UIActivityType.postToFacebook | |
| if installedFB && isFB { | |
| return nil |
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
Show hidden characters
| [ | |
| { | |
| "caption": " 📱", | |
| "command": "shell_command", | |
| "args": { | |
| "command": "open -a '/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app'", | |
| } | |
| }, | |
| { | |
| "caption": " 🏭📱", |
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
| 語言辨識:zh-Hant | |
| 斷詞:["戚戚", "堆積", "到", "淒慘", "得", "急", "憔悴", "冷冷清清", "傷心", "這", "也", "點點滴滴", "將息", "杯", "淡", "時候", "摘", "慘", "黃", "酒", "獨自", "最", "他", "有", "淒", "怎", "正", "梧桐", "難", "更", "字", "窗兒", "守", "風", "是", "如今", "兩", "乍暖還寒", "盞", "次第", "個", "尋尋覓覓", "堪", "舊時", "過", "愁", "怎生", "了得", "敵", "來", "相識", "花", "誰", "雁", "著", "黑", "卻", "晚", "黃昏", "細雨", "三", "滿地", "兼", "一", "損"] | |
| 詞性標記 | |
| 詞形還原 | |
| 具名實體辨識 | |
| 語言辨識:en | |
| 斷詞:["no", "I", "my", "\'ll", "wilt", "Capulet", "thou", "not", "if", "be", "and", "but", "Romeo", "love", "name", "thy", "wherefore", "longer", "O", "art", "a", "And", "father", "Deny", "Or", "sworn", "refuse"] | |
| 詞性標記 | |
| no:Adverb | |
| I:Pronoun |
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
| #!/usr/bin/env ruby18 | |
| require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor" | |
| require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document" | |
| TextMate.save_current_document | |
| TextMate::Executor.make_project_master_current_document | |
| command = ["swipl", "-f", "#{ENV["TM_FILEPATH"]}", "-t", "main", "-g", "true", "--quit"] | |
| TextMate::Executor.run(command) |