Skip to content

Instantly share code, notes, and snippets.

View Circuit8's full-sized avatar

Joshua Harris Circuit8

View GitHub Profile
def create_payment_method source_id
begin
source = stripe_customer.sources.create({source: source_id})
stripe_customer.default_source = source_id
stripe_customer.save
rescue => e
Rails.logger.error e.message
end
end
@Circuit8
Circuit8 / console_output.rb
Last active January 26, 2017 13:44
Actioncable not working in feature specs, capybara-webkit
# This is the error when printing the output of the javascript console in my feature spec
WebSocket connection to 'ws://127.0.0.1:32789/cable' failed: Unexpected response code: 200
fd = IO.sysopen "badger.txt"
stream = IO.new(fd,"w")
# Errno::EINVAL: Invalid argument
# Why is this happening?
@Circuit8
Circuit8 / error.rb
Created August 16, 2016 10:26
Error when I run `bundle exec rspec`. Works fine with bundle exec guard.
bundler: failed to load command: rspec (/home/joshua/.rbenv/versions/2.3.0/bin/rspec)
RuntimeError: missing run or map statement
/home/joshua/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:146:in `to_app'
/home/joshua/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:160:in `block in generate_map'
/home/joshua/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:160:in `each'
/home/joshua/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:160:in `generate_map'
/home/joshua/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:145:in `to_app'
/home/joshua/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/capybara-2.7.1/lib/capybara/rails.rb:13:in `<top (required)>'
/home/joshua/Programs/Ruby/Rails/fitness-members/spec/spec_helper.rb:2:in `require'
/home/joshua/Programs/Ruby/Rails/fitness-members/spec/spec_helper.rb:2:in `<top (required)>'
import React from 'react'
import ReactDOM from 'react-dom'
import Instruction from '../components/instruction'
export default class InstructionList extends React.Component{
constructor(props){
super(props)
this.state = {
class Exercise < ApplicationRecord
has_one :image, :as =>:imageable
accepts_nested_attributes_for :image
end
api GET /api/products/:id/fabrics(.:format) api/fabrics#index {:format=>:json}
class DeleteButton extends React.Component {
render () {
if( this.props.active ){
confirm = <confirmationModal />
}
return(
<a href={this.props.url}
data-method="delete"
className="delete-button"
2016-06-17T10:21:23.531139+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxx request_id=xxx fwd="xxx" dyno= connect= service= status=503 bytes=