View bench_rails_memory_usage.rb
require "net/http"
def start_server
# Remove the X to enable the parameters for tuning.
# These are the default values as of Ruby 2.2.0.
@child = spawn(<<-EOC.split.join(" "))
XRUBY_GC_HEAP_FREE_SLOTS=4096
XRUBY_GC_HEAP_INIT_SLOTS=10000
XRUBY_GC_HEAP_GROWTH_FACTOR=1.8
XRUBY_GC_HEAP_GROWTH_MAX_SLOTS=0
View carrierwave.rb
#config/initializers/carrierwave.rb
module CarrierWave
module MiniMagick
# Rotates the image based on the EXIF Orientation
def exif_rotation
manipulate! do |img|
img.auto_orient
img = yield(img) if block_given?
img
end
View CiviCRM
<script type="text/javascript">
var CRM = {"config":{"isFrontend":false}};
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/bower_components/jquery/dist/jquery.min.js?r=aBEHT">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/bower_components/jquery-ui/jquery-ui.min.js?r=aBEHT">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/bower_components/lodash-compat/lodash.min.js?r=aBEHT">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js?r=aBEHT">
View S3InstallUbuntu
# Install with:
# bash < <(curl -L https://raw.github.com/gist/2767174)
echo "Installing S3cmd..."
wget -O- -q http://s3tools.org/repo/deb-all/stable/s3tools.key | sudo apt-key add -
sudo wget -O/etc/apt/sources.list.d/s3tools.list http://s3tools.org/repo/deb-all/stable/s3tools.list
sudo apt-get update && sudo apt-get install s3cmd
echo "Done"
View gist:5881326

Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git curl
  • Copy/paste from the command line:
View defaults.list
[Default Applications]
x-scheme-handler/txmt=openInMine.desktop
View gist:407842
<a href="http://www.flightline-studios.com/Music/Gone.mp3" onClick="javascript: pageTracker._trackPageview('/downloads/gone'); ">
View extended user lifecycle example
lifecycle do
state :unverified, :default => true
state :verified,:active, :inactive, :banned
create :signup, :available_to => "Guest",
:params => [:name, :real_name, :birthday, :email_address, :password, :password_confirmation],
:become => :unverified, :new_key => true do
if self.birthday.to_time < 18.years.ago
UserMailer.deliver_email_verification(self, lifecycle.key)