例文を組み込んだAlfred Workflowを作りました: Alfred Git Commit Message Example
以下転載:
extension UIViewController { | |
// こんな感じの公開メソッドを増やしていく | |
func observeKeyboard(willShowSelector: Selector, willHideSelector: Selector) -> () -> () { | |
return observeNotification([ | |
(action: willShowSelector, name: UIKeyboardWillShowNotification), | |
(action: willHideSelector, name: UIKeyboardWillHideNotification)]) | |
} | |
func observeDidBecomeActive(action: Selector) -> () -> () { | |
return observeNotification(action, name: UIApplicationDidBecomeActiveNotification) | |
} |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>IDECodeSnippetCompletionPrefix</key> | |
<string>localized</string> | |
<key>IDECodeSnippetCompletionScopes</key> | |
<array> | |
<string>All</string> | |
</array> |
goto loc_100000f00; | |
loc_100000f00: | |
COND = OVERFLOW(rax); | |
if (COND) goto loc_100000f1f; | |
loc_100000f09: | |
rbx = rbx + 0x1; | |
if (rbx != 0x65) goto loc_100000f00; |
let params: [String: AnyObject!] = [ | |
"avatarData": avatarData, | |
"displayName": member.displayName, | |
"currentCharacterId": member.currentCharacterId, | |
"profileView.birthday": member.birthday, | |
"sex": member.sex.rawValue, | |
"profileView.bloodType": member.bloodType.rawValue, | |
"address.country": member.address.country.rawValue, // "address: account.address!.dictはbindされないので。通常のrequestならOK" | |
"profileView.address.prefectures": member.address.prefectures.rawValue, | |
"profileView.hometown.country": member.hometown.country.rawValue, |
以下転載:
{ | |
"global": { | |
"ask_for_confirmation_before_quitting": true, | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": false, | |
"show_profile_name_in_menu_bar": false, | |
"unsafe_ui": false | |
}, | |
"profiles": [ | |
{ |
import UIKit | |
extension UIColor { | |
class var theme: UIColor { return #colorLiteral(red: 0.4274509804, green: 0.7568627451, blue: 0.6196078431, alpha: 1) } | |
class var notification: UIColor { return #colorLiteral(red: 1, green: 0.4666666667, blue: 0, alpha: 1) } | |
class var negative: UIColor { return #colorLiteral(red: 0.9843137255, green: 0.4588235294, blue: 0.4588235294, alpha: 1) } | |
class var darkBackground: UIColor { return #colorLiteral(red: 0.1725490196, green: 0.1725490196, blue: 0.1725490196, alpha: 1) } | |
class var darkLightBackground: UIColor { return #colorLiteral(red: 0.3401621282, green: 0.3401621282, blue: 0.3401621282, alpha: 1) } | |
} |
import UIKit | |
extension UIColor { | |
class var theme: UIColor { return #colorLiteral(red: 0.4274509804, green: 0.7568627451, blue: 0.6196078431, alpha: 1) } | |
// 別解1(推奨) | |
struct MyApp { | |
static var theme: UIColor { return #colorLiteral(red: 0.4274509804, green: 0.7568627451, blue: 0.6196078431, alpha: 1) } | |
} | |
import UIKit | |
extension UIColor { | |
struct JoinUs { | |
private init() {} | |
/** #6DC19E */ | |
static let theme = #colorLiteral(red: 0.4274509804, green: 0.7568627451, blue: 0.6196078431, alpha: 1) | |
/** #FF7700 */ | |
static let notification = #colorLiteral(red: 1, green: 0.4666666667, blue: 0, alpha: 1) | |
/** #FB7575 */ |
let emojiLogFormatter = PrePostFixLogFormatter() | |
emojiLogFormatter.apply(prefix: "🗯🗯🗯 ", postfix: " 🗯🗯🗯", to: .verbose) | |
emojiLogFormatter.apply(prefix: "🔹🔹🔹 ", postfix: " 🔹🔹🔹", to: .debug) | |
emojiLogFormatter.apply(prefix: "ℹ️ℹ️ℹ️ ", postfix: " ℹ️ℹ️ℹ️", to: .info) | |
emojiLogFormatter.apply(prefix: "⚠️⚠️⚠️ ", postfix: " ⚠️⚠️⚠️", to: .warning) | |
emojiLogFormatter.apply(prefix: "‼️‼️‼️ ", postfix: " ‼️‼️‼️", to: .error) | |
emojiLogFormatter.apply(prefix: "💣💣💣 ", postfix: " 💣💣💣", to: .severe) | |
log.formatters = [emojiLogFormatter] |