Skip to content

Instantly share code, notes, and snippets.

View TerryCK's full-sized avatar

Guan-Jhen (Terry) TerryCK

  • Taipei, Taiwan
View GitHub Profile
@HarishChaudhari
HarishChaudhari / country-code-to-currency-code-mapping.csv
Last active June 28, 2024 13:56
Country, Country Code, Currency code mapping in CSV format Taken from https://gist.github.com/304261 Contains 249 countries.
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 27, 2024 13:28
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@orkoden
orkoden / tddberlin_iOS_notes.md
Last active May 18, 2021 08:43
Notes from TDD iOS Notes

TDD Workshop Notes

http://tdd-workshop.uikonf.com

Twitter hashtag #tddberlin

Mobile Central Europe Conference in Warsaw in Feb 2015

Resources

Reading

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
//
// Deserializable.swift
// MapperDemo
//
// Created by 默司 on 2016/12/1.
// Copyright © 2016年 默司. All rights reserved.
//
import Foundation
import SwiftyJSON
@mosluce
mosluce / Example.swift
Last active December 1, 2016 14:53
Protocol Oriented 練習:Deserialize JSON and XML
import Foundation
struct User {
var username: String?
var password: String?
}
extension User {
init(_ node: NodeAccessable) {
self.username = node.child("username").string
@mosluce
mosluce / Example.swift
Last active January 14, 2017 04:41
對於常用的 WebAPI 呼叫方式進行擴充 URLSession
/// 範例中使用了 SVProgressHUD, SwiftyJSON
/// 另外 UIAlertController 有 extension
func request(_ path: String, method: HttpMethod = .get, parameters: [String: Any]? = nil, localizedStatus: String? = NSLocalizedString("資料處理中", comment: "呼叫API讀取狀態文字"), _ completion: @escaping (_ json: JSON) -> Void) {
// 顯示 ActivityIndicator
if let status = localizedStatus { SVProgressHUD.show(withStatus: status) }
// 待會使用 GCD 版本所以要 Dispatch 到其他 thread
DispatchQueue.global().async {
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
private var array = [Element]()
public init() { }
@candostdagdeviren
candostdagdeviren / .swiftlint.yml
Last active July 6, 2024 12:11
Sample SwiftLint file to apply best practices
disabled_rules: # rule identifiers to exclude from running
- variable_name
- nesting
- function_parameter_count
opt_in_rules: # some rules are only opt-in
- control_statement
- empty_count
- trailing_newline
- colon
- comma
@pamelafox
pamelafox / GithubClient.gs
Created May 12, 2017 20:51
Google Apps Script for committing a file to Github Repo
/* A bare-bones GithubClient, just used for commits */
function GithubClient(owner, repo, username, passwordOrToken) {
this.owner = owner;
this.repo = repo;
this.username = username;
this.passwordOrToken = passwordOrToken;
}
/*