Skip to content

Instantly share code, notes, and snippets.

#git checkout branch which name containing 2222
co() {
echo "checkout > searching for branches that contains...... $1"
branchName=$(git branch --list \*$1\*)
numberoflines=$(git branch --list \*$1\* | grep "" -c)
if [[ "$numberoflines" -eq "0" ]]; then
branchName=$(git branch --all --list \*$1\*)
numberoflines2=$(git branch --list \*$1\* | grep "" -c)
if [[ "$numberoflines2" = "1" ]]; then
branchName=${branchName//* /}
@mememto
mememto / git-tag-delete-local-and-remote.sh
Created June 25, 2019 09:44 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@mememto
mememto / gist:2cf1c2f4a192860cbb88f03335318c19
Created June 20, 2017 06:25 — forked from kublaios/gist:f01cdf4369c86ddd6d71
Making a PEM File for iOS Push Notifications (From Ray Wenderlich's tutorial)
# Convert the .cer file into a .pem file:
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
# Convert the private key’s .p12 file into a .pem file:
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem
# Finally, combine the certificate and key into a single .pem file
$ cat PushChatCert.pem PushChatKey.pem > ck.pem
# At this point it’s a good idea to test whether the certificate works.