-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
defmodule PostsRouter do | |
use Dynamo.Router | |
alias Ecto.SQL | |
import Ecto.Query | |
prepare do | |
conn.fetch :params | |
end | |
# GET /posts |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
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.
# Given an Excel file... iterate over each cell that has a formula | |
# and collect all the unique formula signatures | |
# formula signature are in RPN and shown as | |
# => Ref#UnaryMinus#Ref#Multiply#Int#Int#Power#Divide#Ref#Multiply | |
# => Ref#Ref#Multiply#Ref#Ref#Multiply#Subtract#Parenthesis#Ref#Multiply#Int#Int#Power#Divide#Ref#Subtract | |
# => Ref#Ref#Multiply#Ref#Ref#Multiply#Subtract#Parenthesis#Ref#Multiply#Int#Int#Power#Divide#Ref#Multiply#Ref#Subtract | |
# => Ref#Ref#Multiply#Int#Int#Power#Divide | |
# => Ref#Area#Attr#Ref#Multiply#Ref#Multiply#Parenthesis#Divide | |
# => Ref#Area#Attr#Ref#Multiply#Int#Int#Power#Divide#Ref#Multiply#Parenthesis#Divide | |
# => Ref#Area#Attr#Ref#Multiply#Int#Int#Power#Divide#Parenthesis#Divide |
require 'date' | |
class Date | |
# Try to read Marshal data of 1.9.3 Date | |
# !!CAUTION: COMPLETELY UNTESTED!!! | |
if RUBY_VERSION < "1.9.3" | |
def marshal_load(ary) | |
case ary.size | |
when 3 | |
@ajd, @of, @sg, = ary |
diff --git a/load.c b/load.c | |
index 9ed386d..1a6f5e9 100644 | |
--- a/load.c | |
+++ b/load.c | |
@@ -270,7 +270,7 @@ rb_provide(const char *feature) | |
NORETURN(static void load_failed(VALUE)); | |
static void | |
-rb_load_internal(VALUE fname, int wrap) | |
+rb_load_internal(VALUE fname, VALUE wrap) |
This is a theoretical benchmark of require
time comparing ruby 1.9.4 r33453 original and patched on a 64-bit Linux with a sequential hard disk.
It is theoretical because it is based on requiring a few hundreds empty files from the same folder, which is likely rare.
However, the global result (patched significantly faster than original) should be reflected in a certain measure in real life.
It is showing especially good results, because a file is never required twice, and so the unpatched version always has to check every file loaded.
The patched version could actually be slower when:
namespace :deploy do | |
desc "Hot-reload God configuration for the Resque worker" | |
task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}" | |
sudo "god start resque" | |
end | |
end | |
# append to the bottom: |
~/repo/ruby
$ mkdir rails/hacker-uplink && cd rails/hacker-uplink && touch Gemfile
~/repo/ruby/rails/hacker-uplink
$ ls
Gemfile
~/repo/ruby/rails/hacker-uplink
$ git init
Initialized empty Git repository in /Users/krainboltgreene/repo/ruby/rails/hacker-uplink/.git/