Skip to content

Instantly share code, notes, and snippets.

Ben Turner phantomwhale

Block or report user

Report or block phantomwhale

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@phantomwhale
phantomwhale / Toys.txt
Last active Jul 22, 2017
When are my toys coming
View Toys.txt
- July
7th Continent
Heroes of Normandie resupply (wave 2)
Lazer Ryderz
Shadows of Brimstone (wave 2)
Spirit Island
The End is Nigh
Tau Ceti
Yokohama
@phantomwhale
phantomwhale / high_voltage_pages_helper.rb
Last active Aug 29, 2015
High Voltage Pages Helper
View high_voltage_pages_helper.rb
module HighVoltagePagesHelper
class << self
include Rails.application.routes.url_helpers
end
module_function
def static_pages
Dir.entries(Rails.root.join('app', 'views', 'pages')).inject([]) do |pages, file|
matches = file.match(/\.html\.[a-z]+$/)
@phantomwhale
phantomwhale / gist:d033674bd92d056a39b6
Created Jul 16, 2014
Keybase identity verification
View gist:d033674bd92d056a39b6
### Keybase proof
I hereby claim:
* I am phantomwhale on github.
* I am benturner (https://keybase.io/benturner) on keybase.
* I have a public key whose fingerprint is 724D 7448 56D0 623E EB75 FC22 5DE1 47DC 4BAB 3CBE
To claim this, I am signing this object:
@phantomwhale
phantomwhale / Command Line
Created Mar 20, 2014
Passing command line arguments into Vagrant to configure Ansible Provisioning
View Command Line
# with a space, this doesn't work...
$ ANSIBLE_ARGS='-t elasticsearch' vagrant provision
==> default: Running provisioner: ansible...
ERROR: tag(s) not found in playbook: elasticsearch. possible values: apache,common,elasticsearch,java,passenger,postgresql,ruby
Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.
# without the space, it now works...
$ ANSIBLE_ARGS='-telasticsearch' vagrant provision
@phantomwhale
phantomwhale / responses_controller_spec.rb
Created Aug 2, 2012
Two Rspec before blocks to stub out some behaviour in a controller.First block works, but is verbose. Second block fails, but unsure why. Last chunk of code is the code being tested.Worth noting that changing the method to 'telect' makes it pass
View responses_controller_spec.rb
# This works, but a bit verbose
before do
@invitation1, @invitation2 = stub_model(Invitation), stub_model(Invitation)
stubbed_scope = stub
Invitation.stub(:accessible_by => stubbed_scope)
stubbed_scope.stub_chain(:select, :where => [@invitation1, @invitation2])
end
# This fails with :
You can’t perform that action at this time.