Skip to content

Instantly share code, notes, and snippets.

View aaronmcadam's full-sized avatar
🎉
Having fun!

Aaron McAdam aaronmcadam

🎉
Having fun!
View GitHub Profile
@jakeonrails
jakeonrails / fix_newrelic_pow.md
Created April 11, 2013 21:12
Newrelic developer mode returns "no route matches" when you hit /newrelic and you happen to be running pow.
@afeld
afeld / gist:5704079
Last active April 21, 2025 15:11
Using Rails+Bower on Heroku
@floehopper
floehopper / spec.rake
Created June 16, 2013 10:11
Run RSpec features separately from 'unit' specs.
units = types.reject { |type, dir| type == 'features' }
namespace :spec do
desc "Run 'unit' specs: #{units.keys.to_sentence}"
RSpec::Core::RakeTask.new(:units) do |t|
t.pattern = units.map { |type, dir| "./#{dir}/**/*_spec.rb" }
end
end
default_task = Rake::Task['default']
@glv
glv / trouble-free-bundler.md
Last active March 16, 2018 14:50
This is a thing I wrote over a year ago for the internal LivingSocial wiki. There's nothing LS-specific about it, and it seems generally useful, so …

Trouble-Free Bundler

Every couple of weeks, I hear someone complaining about some difficulties with Bundler. Yesterday, it happened twice. But somehow I just never have those difficulties. I'm not saying Bundler is perfect; certainly in its early days it wasn't even close. But for the past two years it's been incredibly solid and trouble-free for me, and I think a large part of the reason is the way I use it. Bundler arguably does too much, and just as with Git, a big part of it is knowing what not to do, and configuring things to avoid the trouble spots.

@plentz
plentz / nginx.conf
Last active May 3, 2025 05:27
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@Stanback
Stanback / nginx.conf
Last active March 30, 2025 03:57 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@marktabler
marktabler / Benchmark Notes
Last active December 29, 2015 09:19
Ruby API Framework Benchmarks
Sinatra 1.4.4
Rails 4.0.1
Rails-API 0.1.0
Rails-API disabled Mailer and Sockets
Each app connected to a MySQL database via ActiveRecord with an empty Accounts table; each app's root path responded with "#{Account.count} accounts detected."
Each app was configured to use Thin as its web server.
@skwp
skwp / dynamic_method_spec.rb
Created December 7, 2013 00:44
Fail your build for user-defined style rules.
require 'spec/support/grep_matcher'
describe do
disallow_presence_of pattern: "send(.*#",
location: "app/",
description: "Do not use dynamic method invocations",
failure: "Please change dynamic method call to something more sane."
end
@ihassin
ihassin / deploy.rb
Created December 24, 2013 00:11
Capistrano 3 script to deploy the app
set :application, '<APP_NAME>'
set :repo_url, "<git@PATH/REPO.git>"
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
set :deploy_to, "/home/deploy/rails/<APP_NAME>"
# set :scm, :git
set :format, :pretty
set :log_level, :debug
@AhmedElSharkasy
AhmedElSharkasy / best_practices
Last active March 17, 2025 21:12
Rails 3 AntiPatterns, Useful snippets and Recommended Refactoring. Note: Some of them are collected from different online resources/posts/blogs with some tweaks.
Rails as it has never been before :)
Rails 3 AntiPatterns, Useful snippets and Recommended Refactoring.
Note: Some of them are collected from different online resources/posts/blogs with some tweaks.