Skip to content

Instantly share code, notes, and snippets.

View goosetav's full-sized avatar

Erik Gustavson goosetav

View GitHub Profile
@goosetav
goosetav / slacker.rb
Created August 2, 2015 22:27
clean up slack: a channel archival script
#!/usr/bin/env ruby
# The MIT License (MIT)
#
# Copyright (c) 2015 Erik Gustavson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@goosetav
goosetav / gist:9698683
Created March 21, 2014 23:30
example of installing git-prompt into an existing PS1 prompt; now in color!
# git-ify shell prompt
source ~/.git-prompt.sh
GIT_PS1='$(__git_ps1 " \[\033[0;32m\]%s\[\033[0m\]")'
export GIT_PS1_SHOWDIRTYSTATE="1"
export GIT_PS1_SHOWUPSTREAM="auto"
# example PS1 prompt or include $GIT_PS1 into yoru existing prompt
export PS1="\[\e]2;\u \w\a\e[32;1m\]$SI\w$NM$GIT_PS1 #\[\e[0m\] "
@goosetav
goosetav / gist:4004813
Created November 2, 2012 22:42
poltergeist#44 bug output
bundle exec rspec
{"name"=>"visit", "args"=>["http://127.0.0.1:52694/"]}
{"response"=>{"status"=>"success"}}
{"name"=>"render", "args"=>["/Users/erik/Documents/projects/true_type_bug/tmp/poltergeist-1351895942.png", true]}
{"response"=>true}
{"name"=>"reset", "args"=>[]}
{"response"=>true}
.{"name"=>"visit", "args"=>["http://127.0.0.1:52694/"]}
PhantomJS has crashed. Please read the crash reporting guide at https://code.google.com/p/phantomjs/wiki/CrashReporting and file a bug report at https://code.google.com/p/phantomjs/issues/entry with the crash dump file attached: /tmp/7D1CC2D4-97BD-4398-9A2D-68A3603E271A.dmp
{"name"=>"reset", "args"=>[]}
@goosetav
goosetav / howto.md
Created November 1, 2012 21:01
prevent ttf fonts while running poltergeist

RE: teampoltergeist/poltergeist#44

Use Rack::SimpleEndpoint to prevent Poltergeist/PhantomJS from crashing on TTF fonts.

In config/environments/test.rb, add

require 'rack/contrib/simple_endpoint'
config.middleware.insert_after Rack::Runtime, Rack::SimpleEndpoint, /\.ttf$/ do |req, res, match|
  res.status = '403'

"I will not serve TTF fonts in test mode."

@goosetav
goosetav / 0-readme.md
Created October 19, 2012 06:04 — forked from sxua/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

WARNING: not functional yet

Patched ruby 1.9.3-p286 for 30% faster rails boot

Overview

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

Many thanks to funny-falcon for the performance patches.