Skip to content

Instantly share code, notes, and snippets.

@chenrui333
chenrui333 / brew-resources.rb
Created Jul 5, 2020
Updated resource blocks
View brew-resources.rb
# from https://github.com/Homebrew/homebrew-core/pull/57500
# Updated resource blocks generated with: https://repl.it/repls/AnchoredCultivatedModem
require 'open-uri'
require 'json'
pnames = %w[
attrs
certifi
cffi
chardet
View git-hacks.md

better display

better display the commits for readings

$ git log --all --grep='message for the search'  --pretty=oneline --abbrev-commit

cherry-pick

@chenrui333
chenrui333 / remove-multiple-remotes.sh
Created Nov 3, 2019
Clean up multiple git remotes (except rui, upstream and origin)
View remove-multiple-remotes.sh
git remote -v | grep fetch | cut -f 1 | egrep -v '(rui|upstream|origin)' | xargs -I {} git remote remove {}
@chenrui333
chenrui333 / Dockerfile.jenkins
Last active Oct 31, 2019
example base Jenkins Dockerfile
View Dockerfile.jenkins
FROM jenkins/jenkins
USER root
# Add sudo capabilities
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers
# Install vim (useful to have there)
RUN apt-get update && apt-get install -y vim
@chenrui333
chenrui333 / upgrade_to_node_v10.sh
Last active Oct 25, 2019
Upgrade the nodejs lambda runtime to v10
View upgrade_to_node_v10.sh
#!/bin/bash
# repo and ticket env setup
REPO_NAME="pro-admin-onboard-email-lambda"
PT_TICKET="XX"
# checkout the repo and branch
git clone git@github.com:meetup/${REPO_NAME}.git
cd ${REPO_NAME}
git checkout -b ${PT_TICKET}-node-10.16.3
@chenrui333
chenrui333 / brew-fetch-error-log.txt
Last active Oct 19, 2019
brew-fetch formula run
View brew-fetch-error-log.txt
Start checking!!!
brew fetch --build-bottle abcde
brew fetch --build-bottle afio
@chenrui333
chenrui333 / minikube-build-log.md
Last active Oct 3, 2019
Minikube golang v1.13.1 upgrade
View minikube-build-log.md
$ make -j 16 all
which go-bindata || GO111MODULE=off GOBIN=/Users/rchen/go/bin go get github.com/jteeuwen/go-bindata/...
/usr/local/bin/go-bindata
PATH="/Users/rchen/.gvm/bin:/Users/rchen/.goenv/bin:/Users/rchen/.nenv/shims:/Users/rchen/.nenv/bin:/Users/rchen/.avn/bin:/usr/local/opt/swagger-codegen@2/bin:/Users/rchen/.rbenv/shims:/Users/rchen/bin:/Users/rchen/.nvm/versions/node/v10.16.3/bin:/Users/rchen/.yarn/bin:/Users/rchen/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/rchen/go/bin:/usr/local/opt/go/libexec/bin:/Users/rchen/bin:/Users/rchen/go/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
which go-bindata || GO111MODULE=off GOBIN=/Users/rchen/go/bin go get github.com/jteeuwen/go-bindata/...
/usr/local/bin/go-bindata
PATH="/Users/rchen/.gvm/bin:/Users/rchen/.goenv/bin:/Users/rchen/.nenv/shims:/Users/rchen/.nenv/bin:/Users/rchen/.avn/bin:/usr/local/opt/swagger-codegen@2/bin:/Users/rchen/.rbenv/shims:/Users/rchen/b
@chenrui333
chenrui333 / settings.json
Last active Aug 29, 2019
my vscode workspace settings.json
View settings.json
{
"explorer.autoReveal": true,
"window.zoomLevel": 0,
"git.confirmSync": false,
"git.enableSmartCommit": true,
// The number of spaces a tab is equal to. This setting is overridden
// based on the file contents when `editor.detectIndentation` is true.
"editor.tabSize": 2,
View git-merged-branches-cleanup.md

cleanup the merged branches

git branch -r --merged | 
grep origin | 
grep -v '>' | 
grep -v master | 
xargs -L1 | 
cut -d"/" -f2- | 
xargs git push origin --delete
View gist:a6ab4f8f8d621ff5123d271bf7404d9b
git config --global push.default current
git config --global pull.rebase true
You can’t perform that action at this time.