Skip to content

Instantly share code, notes, and snippets.

View guoc's full-sized avatar

Chen Guo guoc

  • Melbourne, Australia
View GitHub Profile
@guoc
guoc / space-launcher.xml
Last active May 12, 2017 11:35
Hold space bar and press a key to launch/open something.
<?xml version="1.0"?>
<!--
This is a Karabiner configuration file.
Hold space bar and press a key to launch/open something.
e.g.
space + ` to open home folder
space + 1 to open Dropbox folder
space + S to launch Safari
@guoc
guoc / UIColor+System.swift
Created April 10, 2017 23:30
UIColor (system's color scheme)
import UIKit
extension UIColor {
struct System { // 20170411 from https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/
private init() {}
static let red = UIColor(red: 255/255, green: 59/255, blue: 48/255, alpha: 1.0)
static let orange = UIColor(red: 255/255, green: 149/255, blue: 0/255, alpha: 1.0)
static let yellow = UIColor(red: 255/255, green: 204/255, blue: 0/255, alpha: 1.0)
@guoc
guoc / UIColor+Solarized.swift
Created April 10, 2017 23:32
UIColor (Solarized)
import UIKit
extension UIColor {
struct Solarized { // 20170411 from http://ethanschoonover.com/solarized
private init() {}
static let base03 = UIColor(red: 0/255, green: 43/255, blue: 54/255, alpha: 1.0)
static let base02 = UIColor(red: 7/255, green: 54/255, blue: 66/255, alpha: 1.0)
static let base01 = UIColor(red: 88/255, green: 110/255, blue: 117/255, alpha: 1.0)
@guoc
guoc / xcode_build_phase.sh
Last active April 14, 2017 00:49 — forked from markcerqueira/xcode_build_phase.sh
Crittercism Auto-Upload dSYM with API Key as an environmental variable
# only upload during Release builds, otherwise every build will upload a dSYM
if [ "${CONFIGURATION}" = "Release" ]; then
readonly API_KEY_PATH=~/.crittercism_api_key
# put the secret key in this file
if [ -f $API_KEY_PATH ]; then
APP_ID="REPLACE_WITH_MY_APP_ID"
API_KEY=$(<$API_KEY_PATH)
# run the script
source "${SRCROOT}"/<CRITTERCISM_DIR_NAME>/dsym_upload.sh
else
@guoc
guoc / .swift
Created April 14, 2017 08:37
Customize UISearchBar's text field
let textFieldInsideSearchBar = searchBar.value(forKey: "searchField") as? UITextField
@guoc
guoc / .plist
Last active April 29, 2017 01:05
Cocoa / macOS: Add URL Scheme
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>add.your.identifier</string>
<key>CFBundleURLSchemes</key>
<array>
<string>urlschemename</string>
</array>
</dict>
@guoc
guoc / luna_pinyin.emoji.dict.yaml
Created November 7, 2017 23:21 — forked from lembacon/luna_pinyin.emoji.dict.yaml
Pinyin-Emoji Dictionary for Squirrel
# Rime dictionary
# encoding: utf-8
---
name: luna_pinyin.emoji
version: "2017.02.10"
sort: by_weight
use_preset_vocabulary: true
...
@guoc
guoc / NSCFRange+Z.swift
Created November 9, 2017 23:44 — forked from codelynx/NSCFRange+Z.swift
NSRange, CFRange Utilities
// NSCFRange+Z.swift
// ZKit
//
// The MIT License (MIT)
//
// Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@guoc
guoc / mac-switch-meta.el
Created November 10, 2017 06:48 — forked from railwaycat/mac-switch-meta.el
meta key switch
;; Keybonds
(global-set-key [(hyper a)] 'mark-whole-buffer)
(global-set-key [(hyper v)] 'yank)
(global-set-key [(hyper c)] 'kill-ring-save)
(global-set-key [(hyper s)] 'save-buffer)
(global-set-key [(hyper l)] 'goto-line)
(global-set-key [(hyper w)]
(lambda () (interactive) (delete-window)))
(global-set-key [(hyper z)] 'undo)
@guoc
guoc / .yaml
Created December 30, 2017 10:55
F:
group:
additional-action:
do:
delay:
0.3
other-keyup-exit-delay:
true
action:
launch-and-cycle-windows.yaml: