Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

chenrui chenrui333

:octocat:
Focusing
Block or report user

Report or block chenrui333

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
View keybase.md

Keybase proof

I hereby claim:

  • I am chenrui333 on github.
  • I am chenrui (https://keybase.io/chenrui) on keybase.
  • I have a public key ASC7D-0GrczI0pjLAu6732VpYciib13jDdqkhoId5o46swo

To claim this, I am signing this object:

@chenrui333
chenrui333 / iterm2.md
Last active Nov 5, 2018
iterm2 key bindings
View iterm2.md

keys for deletion and cursor-moving

  • cmd + Delete, send hex codes 0x15, delete a line
  • option + Delete, send hex codes 0x17, delete a word
  • cmd + <-, send hex code 0x01, move cursor to the beginning
  • cmd + ->, send hex code 0x015, move cursor to the end
@chenrui333
chenrui333 / remove_title_page.py
Created Mar 2, 2017
Python Scripts Collections
View remove_title_page.py
#! /usr/bin/python
# reference: http://stackoverflow.com/questions/39574096/how-to-delete-pages-from-pdf-file-using-python
import glob
from PyPDF2 import PdfFileWriter, PdfFileReader
for fname in glob.glob('./*.pdf'):
infile = PdfFileReader(fname, 'rb')
output = PdfFileWriter()
print("file name:", fname, "with pages: ", infile.getNumPages())
@chenrui333
chenrui333 / spring-tomcat-instrument.md
Last active Feb 18, 2017
Spring Tomcat Instrument
View spring-tomcat-instrument.md

Source Code shows that it is only used for Tomcat 6. This is tied with Spring LTW (LoadTimeWeaving) functionality.

From Spring Documentation, it is not needed for Tomcat 8.0 and higher.

Do not define TomcatInstrumentableClassLoader anymore on Tomcat 8.0 and higher. Instead, let Spring automatically use Tomcat’s new native InstrumentableClassLoader facility through the TomcatLoadTimeWeaver strategy.

@chenrui333
chenrui333 / Dockerfile
Created Jan 5, 2017
Dockerize Pingfederate
View Dockerfile
FROM amazonlinux:latest
MAINTAINER rui.chen <rui.chen@harvardbusiness.org>
ADD pingfederate-8.3.0.zip /
RUN yum install -y unzip wget
RUN wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm" && \
yum install -y jdk-8u91-linux-x64.rpm
You can’t perform that action at this time.