- Randomly mixes input gathering, error handling, and business logic
- imposes cognitive load on the reader
- no digressions
In response to all the responses to: | |
http://twitter.com/rtomayko/status/1155906157 | |
You should never do this in a source file included with your library, | |
app, or tests: | |
require 'rubygems' | |
The system I use to manage my $LOAD_PATH is not your library/app/tests |
# Used to graph results from autobench | |
# | |
# Usage: ruby autobench_grapher.rb result_from_autobench.tsv | |
# | |
# This will generate three svg & png graphs | |
require "rubygems" | |
require "scruffy" | |
require 'csv' | |
require 'yaml' |
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
# Used to graph results from autobench | |
# | |
# Usage: ruby autobench_grapher.rb result_from_autobench.tsv | |
# | |
# This will generate three svg & png graphs | |
require "rubygems" | |
require "scruffy" | |
require 'csv' | |
require 'yaml' |
require 'rubygems' | |
require 'irb' | |
def consolize &block | |
yield | |
IRB.setup(nil) | |
irb = IRB::Irb.new | |
IRB.conf[:MAIN_CONTEXT] = irb.context |
""" | |
Automated installation of ejabberd with a postgresql backend inspired by this | |
article: http://www.planeterlang.org/en/planet/article/How_to_install_ejabberd_2.0.0_with_PostgreSQL_support/ | |
""" | |
from fabric.api import run, sudo | |
EJABBERD_VERSION = '2.0.5' | |
EJABBERD_SOURCE_HOME = '~/dev/xmpp/oss' | |
POSTGRES_PSQL_PASSWORD = 'user' |
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS | |
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing). | |
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here: | |
* Heroku Hostname SSL | |
* GoDaddy Standard SSL Certificate | |
* Zerigo DNS |
require 'spec_helper' | |
describe Users::OauthCallbacksController, "handle facebook authentication callback" do | |
describe "#annonymous user" do | |
context "when facebook email doesn't exist in the system" do | |
before(:each) do | |
stub_env_for_omniauth | |
get :facebook |
class AuthenticationsController < ApplicationController | |
before_filter :authenticate_user!, :only => :destroy | |
def create | |
omniauth = request.env['omniauth.auth'] | |
authentication = Authentication.find_by_provider_and_uid(omniauth["provider"], omniauth["uid"]) | |
if current_user | |
if authentication && authentication.try(:user) != current_user | |
flash[:error] = I18n.t("This %{provider} account is already connected to another account in our service", :provider => authentication.provider) | |
elsif authentication.nil? |