跳到主要內容

文章

目前顯示的是 一月, 2016的文章

[MAC] 將wav+cue檔切成mp3

有時從網路取得的檔案會是一整個wav或flac再加一個cue檔來描述 但這種檔案在播放時得用特定的軟體來播,所以還是分開來比較方便~   軟體位置 http://external.informer.com/mediahuman.com/youtube-to-mp3-converter   wav and cue file               開啟app並將wav檔拉進去                                     點Yes,                                        設定輸出的格式,因為是自己要聽的,就選高一點                     全選匯出就完成啦                                       會多一個新的目錄Converted by MediaHuman,切好的檔案會在這                     至於中文亂碼的問題,我是再打開Tag Editor Free來編輯~    

Sublime Plugins

安裝 Package Control 1.按下command + ~ 2.貼上import command https://packagecontrol.io/installation#st2 JsFormat (排版) cmd + alt + f JSHint ctrl + j Pretty JSON ctrl + alt + j Alignment ctrl + alt + a Trimmer ctrl + alt + s Find Function Definition F8 keymapManager ctrl + alt + k   中文亂碼 Codecs33 https://github.com/seanliang/Codecs33/tree/osx   簡繁轉 ChineseOpenConvert https://packagecontrol.io/packages/ChineseOpenConvert

[iOS] TextView Attributes 設定 字型 樣式

TextView Attributes 設定 字型 樣式                    var noteContent = "" noteContent += "條碼使用時機\n" noteContent += "1、結帳時出示「手機條碼」累計消費\n" noteContent += "2、出示「消費折抵/贈獎兌換條碼」使用電子贈品禮券或兌換卡友禮\n\n" noteContent += "加入會員好處\n" noteContent += "1、享有停車優惠\n" noteContent += "2、省下周慶時排隊換禮券的時間\n" noteContent += "3、卡友周慶可獨享購物禮遇\n" let optimumTextViewFontSize: CGFloat = 14.0 let myAttribute = [ NSForegroundColorAttributeName: UIColor.whiteColor(), NSFontAttributeName: UIFont.systemFontOfSize(optimumTextViewFontSize) ] let myString = NSMutableAttributedString(string: noteContent, attributes: myAttribute ) let myAttribute2 = [ NSForegroundColorAttributeName: UIColor(hexString: "#E7B3B0")!, NSFontAttributeName: UIFont.boldSystemFontOfSize(optimumTextViewFontSize + 8), NSUnderlineStyleAttributeName: 1 ] let myString2 = NSMutableAttributedString(string: "現在立即加入,還可獲得100點\n", attributes:

[iOS] 動態 的 UITableViewCell Height

動態 的 UITableViewCell Height var heightsCache: Dictionary = [:] var cellDefaultHeight: CGFloat! override func viewDidLoad() { self.tableView.dataSource = self self.tableView.delegate = self let scale = UISizeUtils.getScaleFromPlus(self.view) // height = 621 self.cellDefaultHeight = 621.0 * scale tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = self.cellDefaultHeight ... } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { ... self.heightsCache[indexPath] = newCellHeight ... } // MARK: - UITableViewDelegate func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { let height = self.heightsCache[indexPath] if height != nil { return height! }else{ return self.cellDefaultHeight } }

[iOS] 取得目前正顯示的view

目的是為了寫一個簡易的show alert message的method //程式碼 extension UIApplication { class func topViewController(base base: UIViewController? = UIApplication.sharedApplication().keyWindow?.rootViewController) -> UIViewController? { if let nav = base as? UINavigationController { return topViewController(base: nav.visibleViewController) } if let tab = base as? UITabBarController { if let selected = tab.selectedViewController { return topViewController(base: selected) } } if let presented = base?.presentedViewController { return topViewController(base: presented) } return base } } //用法 let presentedView = UIApplication.topViewController() AlertMessageUtils.showSimpleAlert("系統通知", message: "電量\(values[0])%", view: presentedView!) 參考︰Find the current top view controller for your iOS application https://gist.github.com/snikch/3661188