Skip to content

Instantly share code, notes, and snippets.

View billypchan's full-sized avatar
😶
Focusing

Bill Chan billypchan

😶
Focusing
View GitHub Profile
@billypchan
billypchan / dummyPR.sh
Created October 26, 2021 13:18
Create dummy Github PR and make a comment on bash
git checkout develop
git pull
echo "Time: $(date)." > a.txt
cleanGitBranch.sh
git branch chore/bump
git checkout chore/bump
git add .
git commit -m"dummy"
@billypchan
billypchan / .gitignore
Last active October 26, 2021 14:00 — forked from onmyway133/.gitignore
AutoLayoutConverter - 🐜 Convert Cartography to NSLayoutAnchor
.DS_Store
.tags*
/.idea/
/build/
/dist/
/external_binaries/
/out/
/vendor/download/
/vendor/debian_jessie_amd64-sysroot/
/vendor/debian_jessie_arm-sysroot/
@billypchan
billypchan / cleanBumpBranches.sh
Last active January 13, 2022 15:24
Clean up all bump PR branches
##clean up all remote branches with name "chore/bump_*"
cleanGitBranch.sh
git branch -r --sort=-committerdate --list 'origin/chore/bump_*' | sed "s/origin\///" | xargs -I {} git push origin --delete {}
@billypchan
billypchan / xcstrings.swift
Last active July 18, 2023 09:44
Export TrackData to Xcode 15 Localization catalog
struct TrackData: Codable {
var strings: [String: Track]
}
struct Track: Codable {
let extractionState: String
let localizations: [String: Localization]
}
struct Localization: Codable {
@billypchan
billypchan / LocalizeCatalogCodable.swift
Last active July 18, 2023 12:04
decode Localizable.xcstrings
//
// main.swift
// LocalizeCatalogCodable
//
// Created by Bill, Yiu Por Chan on 18.07.23.
//
import Foundation
struct Localizable: Codable {
@billypchan
billypchan / PhraseListStringID.swift
Last active July 18, 2023 20:48
Getting Phrase.com String rsc key and id
import Cocoa
import Foundation
// Set up your authentication token
let authToken = "authToken"
// Specify the project ID
let projectId = "projectId"
@billypchan
billypchan / BST_Sequences.swift
Created December 20, 2023 23:57
Swift BST Sequences answer
//
// main.swift
// BST_Sequences
//
// Created by Bill, Yiu Por Chan on 12/20/23.
//
import Foundation
class Node {