Skip to content

Instantly share code, notes, and snippets.

View jwo's full-sized avatar

Jesse Wolgamott jwo

View GitHub Profile
@jwo
jwo / code_schools.md
Last active December 31, 2015 20:58
Code schools around US
@jwo
jwo / secret_controller_spec.rb
Created November 5, 2013 18:16
RSpec controller testing devise
require 'spec_helper'
describe SecretController do
let(:user) { User.create! email: "[email protected]",
password: "the-secrets",
password_confirmation: "the-secrets"
}
before do
@request.env["devise.mapping"] = Devise.mappings[:user]
@jwo
jwo / secret_controller.rb
Created November 5, 2013 17:57
Devise testing controllers - minitest / rails4
class SecretController < ApplicationController
before_filter :authenticate_user!
def show
end
end
@jwo
jwo / rfp-response.md
Created September 5, 2013 14:52
Standard Response for RFP's

$client,

As a rule, I don't participate in RFP's. In my experience RFPs lead to clients choosing the least cost, rather than the best creative fix. I know some companies require the process, and I understand that reality.

Best of luck in the process and in the future.

- jesse

@jwo
jwo / remove-this-sf_bs3_inputs.rb
Created August 15, 2013 15:50
Simple Form 3 & Bootstrap 3
#config/initializers/remove-this-sf_bs3_inputs.rb
#Credit: https://github.com/rafaelfranca/simple_form-bootstrap/issues/26#issuecomment-22435894
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
@jwo
jwo / jwo.sig.txt
Created June 26, 2013 20:58
JWO Signature because ASCII Rules
_
(_)_ _____
| \ \ /\ / / _ \
| |\ V V / (_) |
_/ | \_/\_/ \___/
|__/
@jwo
jwo / user_balance_report.rb
Last active December 18, 2015 16:49
Step 2: better
class User
attr_reader :first_name, :last_name
def initialize(first_name, last_name)
@firstName = first_name
@lastName = last_name
end
def full_name
@jwo
jwo / user_account_report.rb
Last active December 18, 2015 16:49
The before picture. Your job, should you choose to accept it: make it better!
class User
def initialize(first_name, last_name)
@firstName = first_name
@lastName = last_name
end
def full_name
"#{@lastName} #{@firstName}"
end
@jwo
jwo / calculate_the_thing.rb
Last active December 17, 2015 20:09
Simple callback-esque way to calculate in the background, and have the result later on by storing a reference to it in the session
class CalculateTheThing
include Celluloid
def calculate
sleep 5
result = rand
yield(result) if block_given?
result
end
end
Started GET "/pages/create" for 127.0.0.1 at 2013-05-22 13:15:01 -0500
Processing by PagesController#create as HTML
About to sleep 2013-05-22 13:15:01 -0500
Rendered pages/create.html.erb within layouts/application (0.5ms)
Completed 200 OK in 8ms (Views: 5.3ms | ActiveRecord: 0.0ms)
Awake! 2013-05-22 13:15:11 -0500