Skip to content

Instantly share code, notes, and snippets.

View innocarpe's full-sized avatar
🎯
Focusing

Wooseong Kim innocarpe

🎯
Focusing
View GitHub Profile
@innocarpe
innocarpe / alfred-iterm
Created March 6, 2019 08:33
iTerm workflow applescript for Alfred
set shortcut to "{query}"
if shortcut is equal to "d" then
set _path_ to "~/Desktop"
else if shortcut is equal to "gitsh" then
set _path_ to "~/.gitsh"
else
set _path_ to "~"
end if
@innocarpe
innocarpe / git-rbb
Last active September 6, 2019 09:24
Rebase latest remote base branch when you working on a feature branch
#!/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
@innocarpe
innocarpe / git-cp
Last active September 6, 2019 09:26
Shortcut for git cherry-pick
#!/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
@innocarpe
innocarpe / git-findmerge
Last active September 6, 2019 09:26
Find the merge commit from a commit hash & Print the log
#!/bin/bash
# This will find you the merge commit from a commit hash, and print the log of it.
# Use this when you want to know about the merged branch which includes that commit.
#
# 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-findmerge
# 4. Use the command 'git findmerge COMMIT_HASH'
@innocarpe
innocarpe / git-rbd
Last active September 6, 2019 09:27
Rebase remote develop branch when you working on a feature branch
#!/bin/bash
# Rebase remote develop when you are working on a feature branch
# + delete merged remote/local branches
#
# `git rbd` is a abbreviation of `git rebase develop` :-)
#
# This will...
# 1. Commit current changes temporarily if there are uncommitted changes
# 2. Checkout current branch to develop
# 3. Pull remote develop with '--prune' option
@innocarpe
innocarpe / git-rih
Last active September 6, 2019 09:27
Short git command for git interactive rebase (w/ last N commits)
#!/bin/bash
# This runs interactive rebase with short command.
# It is equal to `git rebase -i HEAD~$OFFSET
# 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-ri
# 4. Use the command 'git rih 4'
@innocarpe
innocarpe / git-ri
Last active September 6, 2019 09:27
Short git command for git interactive rebase (w/ specific commit)
#!/bin/bash
# This runs interactive rebase with autosquash in short command.
# It is equal to `git rebase -i COMMIT_HASH~1`
# 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-ri
# 4. Use the command 'git ri COMMIT_HASH'
@innocarpe
innocarpe / git-cof
Last active October 14, 2019 06:58
Fixup uncommited changes into target commit
#!/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-pmf
Last active August 12, 2020 02:56
Short git command of `git push origin CURRENT_BRANCH --force`
#!/bin/bash
# This will forch push current branch to origin
# This is just a short version of devxoul's `git pushme` script
# https://gist.githubusercontent.com/devxoul/a972ba0db2a25b989887/raw/f62353501becb274eb63c76b83fbcc01250a 286d/git-pushme
#
# 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-pmf
@innocarpe
innocarpe / LazySequenceTest.playground
Last active September 10, 2020 09:07
LazySequenceTest
import UIKit
struct NewHashtagFeed {
let components: [Component]
init(components: [Component]) {
self.components = components
}
}