Skip to content

Instantly share code, notes, and snippets.

View jsmestad's full-sized avatar
👾

Justin Smestad jsmestad

👾
View GitHub Profile

ruby-1.9.3-p362 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p362 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

{
"_links": {
"self": { "href": "/foo" },
},
"_controls": {
"attack": {
"target": "/attacks",
"method": "POST",
"headers": {
"Content-Type": "application/json"
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@rantav
rantav / README.md
Created August 23, 2012 06:13
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@johntyree
johntyree / getBlockLists.sh
Last active May 10, 2025 11:03
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@intarstudents
intarstudents / os_x_10.8.md
Created July 28, 2012 10:00
OS X 10.8 on GA-H67N-USB3-B3-F9

Install MultiBeast 4.6.1:

+ UserDSDT Install
+ System Utilities
- Drivers & Bootloaders
  - Kexts & Enablers
    - Audio
      - Realtek ALC8xx
 - Unified Device Injector
@dreki
dreki / dst_helper.rb
Created June 20, 2012 20:12
Fix for unexpected :time column behavior in Rails 3.2
module DstHelper
# Have a Time inherit DST status from a Date.
def inherit_dst date, time
time = time.change(:year => date.year, :month => date.mon, :day => date.day)
end
def self.included includer
# Mix in class methods.
includer.extend ClassMethods
end
@inopinatus
inopinatus / hstore_accessor.rb
Last active June 29, 2024 17:26
hstore accessor class method for AR
# include from an initializer
module HstoreAccessor
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def hstore_accessor(hstore_attribute, *keys)
Array(keys).flatten.each do |key|
@bogdanconstantinescu
bogdanconstantinescu / application.rb
Created May 9, 2012 15:26 — forked from t2/application.rb
Formatting Rails form elements for Twitter Bootstrap error validation
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe
# add nokogiri gem to Gemfile
form_fields = [
'textarea',
'input',
'select'
]
@follmann
follmann / rbenv-install-system-wide.sh
Created February 14, 2012 21:36 — forked from v1nc3ntlaw/rbenv-install-system-wide.sh
rbenv install on Debian 6 Squeeze
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core curl
apt-get -y install libssl-dev
apt-get -y install libreadline5 libreadline5-dev
apt-get -y install zlib1g zlib1g-dev
# for passenger needed