Skip to content

Instantly share code, notes, and snippets.

View rafecolton's full-sized avatar
👨‍💻
Infrastructure @ Expensify

Rafe Colton rafecolton

👨‍💻
Infrastructure @ Expensify
View GitHub Profile
diff --git a/common.mk b/common.mk
index eb89a2b..59cdfe4 100644
--- a/common.mk
+++ b/common.mk
@@ -630,7 +630,8 @@ file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
{$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
{$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
- {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h
+ {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h \

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@rafecolton
rafecolton / .gitconfig
Last active December 22, 2015 22:19
git tidy - cleans up your remote and local branches
[alias]
tidy = "!git remote prune origin 2>/dev/null; echo \"$(git branch -vv | grep origin | tr '[]*?+' ' ')\" | egrep -v \"$(git branch -r | awk '{print $1}')\" | awk '{print $1}' | xargs git branch -d 2>/dev/null"
refresh = "!git checkout master && git fetch && git pull --rebase && git tidy"
t = "!git tidy"
r = "!git refresh"
@rafecolton
rafecolton / ssh-agent-stuff.bash
Created September 10, 2013 00:15
Keeping your SSH agent around in different sessions.
# export your current socket
echo "export $(env | grep SSH_AUTH_SOCK | head -n 1)" > "$HOME/.ssh/agent.out"
# source that file in your .bash_profile
str='[[ -s "$HOME/.ssh/agent.out" ]] && source ~/.ssh/agent.out'
grep -q "$str" "$HOME/.bash_profile" || echo "$str" >> "$HOME/.bash_profile"
@rafecolton
rafecolton / installing_and_using_gvm.bash
Last active December 20, 2015 02:49
Local Go Development with GVM
##################
# to install gvm #
##################
# install gvm
bash < <(curl -s https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer) 2>/dev/null
# this should be done automatically, but we'll double check that it's there
! grep -q 'gvm' "$HOME/.bash_profile" && \
echo '[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"' >> ~/.bash_profile
@rafecolton
rafecolton / Golang-binary-versioning.md
Last active July 27, 2017 11:15
Copypasta for easy versioning for your Go binaries

Golang Binary Versioning Trick

To use, place the code in version_trick.go in your project. Don't forget to change the namespace to match yours to the actual name of your package.

In addition to version_trick.go, there's a makefile-snippet, that includes the secret sauce for making this trick work. Be sure to change the package name there as well.

Enjoy!

P.S. Special thanks to @meatballhat by way of @syscomet for showing me this trick!