Skip to content

Instantly share code, notes, and snippets.

View maxkomarychev's full-sized avatar
🪲

Max Komarychev maxkomarychev

🪲
View GitHub Profile
@maxkomarychev
maxkomarychev / hubosx.md
Last active December 9, 2019 15:38
Authenticate `hub` from OS X keychain

(original answer mislav/hub#463 (comment))

  1. create token with necessary permissions (https://github.com/github/hub/blob/master/share/man/man1/hub.1.md#github-oauth-authentication)
  2. copy the token
  3. add token into keychain: security add-generic-password -a -s -w, for instance: security add-generic-password -a johndoe -s hub -w (you will be prompted twice for the token, just hit cmd+v and hit enter)
  4. open ~/.bash_profile with your favorite editor
  5. add alias: alias ghub='GITHUB_TOKEN=$(security find-generic-password -s -a -w) hub'
  6. reload your shell config: source ~/.bash_profile
  7. now you can use hub through alias ghub and it will be authorized with your token :)
suppose you have two branches: `master` and `huge_feature` and you want to merge `huge_feature` into `master` but partially
you also can not use `git cherry-pick`, you want to have *real merge* but with partially applied patch
1. git checkout master
2. git merge --no-ff --no-commit huge_feature
3. git reset *
4. git add -i // interactively stage what you want https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
5. git commit
6. git checkout huge_feature
7. git merge -s ours master // this is to be able to merge huge_feature into master later
enable-ssh-support
write-env-file
use-standard-socket
pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
@maxkomarychev
maxkomarychev / .bash_profile
Last active January 22, 2016 22:13
part of .bash_profile on OS X that launches an instance of gpg-agent per console session
# gpg-agent initialization
GPG_INFO_FILE=${HOME}/.gpg-agent-info
if [ -f "$GPG_INFO_FILE" ]; then
source "$GPG_INFO_FILE"
fi
RUNNING_DAEMON=$(ps -p $SSH_AGENT_PID 2> /dev/null | tail -n+2 | grep gpg)
@maxkomarychev
maxkomarychev / makeicons.sh
Last active August 29, 2015 14:06
Create icons for iOS universal application
#!/bin/sh
convert -resize 29 $1 PhoneSpot29.png
convert -resize 58 $1 [email protected]
convert -resize 87 $1 [email protected]
convert -resize 80 $1 [email protected]
convert -resize 120 $1 [email protected]
convert -resize 57 $1 PhoneApp57.png