This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mysqld] | |
# Slow Log | |
#slow_query_log = 1 | |
#log_queries_not_using_indexes = 1 | |
#long_query_time = 1 | |
# Disable DNS lookups for performance | |
skip_name_resolve | |
# MySQL >= 5.5.5 uses InnoDB by default, but set it just in case |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
# Be sure to have rails and thin installed. | |
require "rubygems" | |
# We are not loading Active Record, nor the Assets Pipeline, etc. | |
# This could also be in your Gemfile. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
# The following lines should come as no surprise. Except by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on the discussion here: https://github.com/aiwilliams/dataset/issues/3 | |
# Used to optimized the datasets being created in your tests. | |
# Currently works in a test suite for a production app with Postgresql | |
# | |
# TODO | |
# - gemify | |
# - add tests | |
# - be able to reuse datasets accross files (declare them in a shared context) | |
# - support other databases than postgres | |
# - file access optimization (only read once during a test run) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy/paste of simple_format from Rails but with <p> removed. | |
def simpler_format(text, html_options={}, options={}) | |
text = text ? String.new(text) : '' | |
text = sanitize(text) unless options[:sanitize] == false | |
text = text.gsub(/\r\n?/, "\n") | |
text.gsub!(/\n\n+/, "<br /><br />") | |
text.gsub!(/\n/, "<br />") | |
text.concat!("<br />") | |
text.html_safe | |
end |