Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Wooseong Kim innocarpe

🎯
Focusing
View GitHub Profile
@innocarpe
innocarpe / git-reb
Created Sep 22, 2020
Rebase latest base branch after pull when you working on a feature branch
View git-reb
#!/bin/bash
# This runs interactive rebase with short command.
# It is equal to `git pull --rebase origin BRANCH_NAME`
# 1. Move this file to ~/.gitsh/
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file
# (like ~/.bash_profile or ~/.zshrc)
# 3. chmod 0755 git-reb
# 4. Use the command 'git reb BRANCH_NAME'
BRANCH_NAME=$1
View LazySequenceTest.playground
import UIKit
struct NewHashtagFeed {
let components: [Component]
init(components: [Component]) {
self.components = components
}
}
@innocarpe
innocarpe / .zshrc
Last active Jan 14, 2021
.zshrc (Public Purpose)
View .zshrc
...
# Open a scheme on the iOS Simulator
# Usage:
# $ deeplink "URL"
# $ deeplink "DEVICE" "URL"
function deeplink() {
if [ $2 ]; then
local device=$1
local url=$2
@innocarpe
innocarpe / git-cof
Last active Oct 14, 2019
Fixup uncommited changes into target commit
View git-cof
#!/bin/bash
# Fixup uncommited changes into target commit
#
# `git cof` is a abbreviation of `git COmmit & Fixup rebase` :-)
#
# This will...
# 1. Commit uncommited changes with message "fixup! TARGET_COMMIT_HASH"
# 2. Fixup the commit meld into target commit with no interaction (non-interactive interactive rebase)
#
# Instruction
@innocarpe
innocarpe / git-cp
Last active Sep 6, 2019
Shortcut for git cherry-pick
View git-cp
#!/bin/bash
# It is equal to `git cherry-pick START_BRANCH^..END_BRANCH`
# 1. Move this file to ~/.gitsh/
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file
# (like ~/.bash_profile or ~/.zshrc)
# (This would be like 'export PATH=${PATH}:/Users/YOUR_HOME_PATH/.gitsh')
# 3. chmod 0755 git-cp
# 4. Use the command 'git cp START_BRANCH END_BRANCH'
START_BRANCH=$1
View git-fp
#!/bin/bash
# It is equal to `git fetch -p & git pull origin BRANCH_NAME`
# 1. Move this file to ~/.gitsh/
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file
# (like ~/.bash_profile or ~/.zshrc)
# (This would be like 'export PATH=${PATH}:/Users/YOUR_HOME_PATH/.gitsh')
# 3. chmod 0755 git-fp
# 4. Use the command 'git fp BRANCH_NAME'
BRANCH_NAME=$1
git fetch -p & git pull origin $BRANCH_NAME
@innocarpe
innocarpe / git-rif
Last active Sep 6, 2019
(non-interactive) interactive rebase with autosquash in short command
View git-rif
#!/bin/bash
# This runs (non-interactive) interactive rebase with autosquash in short command.
# 1. Move this file to ~/.gitsh/
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file
# (like ~/.bash_profile or ~/.zshrc)
# (This would be like 'export PATH=${PATH}:/Users/YOUR_HOME_PATH/.gitsh')
# 3. chmod 0755 git-rif
# 4. Use the command 'git ri COMMIT_HASH'
commit_hash=$1
@innocarpe
innocarpe / git-pp
Last active Sep 22, 2020
Pull remote branch & Delete merged branches.
View git-pp
#!/bin/bash
# Pull remote branch & Delete merged branches.
# 1. Move this file to ~/.gitsh/
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file
# (like ~/.bash_profile or ~/.zshrc)
# (This would be like 'export PATH=${PATH}:/Users/YOUR_HOME_PATH/.gitsh')
# 3. chmod 0755 git-pp
# 4. Use the command 'git pp'
git pull --prune
View ActivityIndicatorCellNode.swift
import AsyncDisplayKit
final class ActivityIndicatorCellNode: ASCellNode {
let activityIndicatorView: UIActivityIndicatorView
let node: ASDisplayNode
override init() {
let activityIndicatorView = UIActivityIndicatorView().then {
$0.style = .gray
}
@innocarpe
innocarpe / git-rbb
Last active Sep 6, 2019
Rebase latest remote base branch when you working on a feature branch
View git-rbb
#!/bin/bash
# Rebase latest remote base branch when you are working on a feature branch
# + delete merged remote branches
#
# `git rbb` is a abbreviation of `git ReBase Base branch` :-)
#
# This will...
# 1. Commit current changes temporarily if there are uncommitted changes
# 2. Pull base branch with '--prune' option without checkout
# 3. Rebase develop