Skip to content

Instantly share code, notes, and snippets.

@spiritbear
spiritbear / rails_engineer.txt
Created July 6, 2017 00:09
Rails Job Description
We are looking to add an experienced Ruby on Rails Developer to our growing team! This position requires at least 2 years of hands-on experience in a developer role.
Experience we are looking for:
- Ruby on Rails, Django or any other MVC Frameworks
- Work independently to design, create, and unit test RoR APIs and applications
- Knowledge of MySQL/PostgreSQL/NoSQL Databases
- Client-side MVC frameworks (Angular/React), JQuery
- Integrating with APIs via REST
- HAML, SASS, CSS, Twitter Bootstrap and Git
- Testing frameworks (Rspec, Cucumber, MiniTest)
def refund_mail_balance
transaction_params = {:transaction_type => 'refund', :amount => @company.current_balance }
transaction_response = CompanyTransactionService.create(@company, 'refund', transaction_params)
if transaction_response.status != 'accept'
raise CustomerlobbyErrors::UnprocessableEntityError.new "Error refunding mail balance: #{transaction_response.status} (#{transaction_response.status_description})"
end
company.update_attributes(:current_balance => 0)
end
def cancel_subscription
require 'rack'
require 'rack/server'
class RemoteIp
def response
[200, {}, 'Hello World']
end
end
2.0.0p247 :008 > Lobbyist::Company.find(141)
NoMethodError: undefined method `<<' for nil:NilClass
from /Users/shivindap/Documents/customerlobby-rails/accounts/lib/lobbyist/lib/lobbyist/error/client_error.rb:10:in `initialize'
from /Users/shivindap/Documents/customerlobby-rails/accounts/lib/lobbyist/lib/lobbyist/base.rb:144:in `new'
from /Users/shivindap/Documents/customerlobby-rails/accounts/lib/lobbyist/lib/lobbyist/base.rb:144:in `handle_response'
from /Users/shivindap/Documents/customerlobby-rails/accounts/lib/lobbyist/lib/lobbyist/base.rb:80:in `get'
from /Users/shivindap/Documents/customerlobby-rails/accounts/lib/lobbyist/lib/lobbyist/company.rb:84:in `find'
from (irb):8
from /Users/shivindap/.rvm/gems/ruby-2.0.0-p247@accounts/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
from /Users/shivindap/.rvm/gems/ruby-2.0.0-p247@accounts/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
@spiritbear
spiritbear / company_schema.xml
Created August 5, 2013 21:31
XML File that enterprises can send us to create accounts.
<?xml version="1.0" encoding="UTF-8" ?>
<companies>
<company>
<company_name>My Company</company_name>
<company_description>Description</company_description>
<address1>1 Main Street</address1>
<address2>Suite #10</address2>
<city>Berkeley</city>
<state>CA</state>
<zip>CA</zip>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<batchjob>
<completedAt>2013-05-21T18:22:13-04:00</completedAt>
<createdAt>2013-05-17T17:38:41-04:00</createdAt>
<errorMessage>2</errorMessage>
<hasErrors>true</hasErrors>
<id>719</id>
<jobs>
<jobId>17243</jobId>
<jobStatus>ERROR</jobStatus>
<html><head><title>Apache Tomcat/7.0.26 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: java.lang.OutOfMemoryError: Java heap
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<batch>
<username>Customerlobby</username>
<password>dx572Kabcd</password>
<filename>test_run.pdf</filename>
<job>
<startingPage>1</startingPage>
<endingPage>2</endingPage>
<printProductionOptions>
@spiritbear
spiritbear / lead_capture.rb
Created November 13, 2012 00:21
Parameters for LeadCapture
default_post_params = {
lead_source: "Web Site",
lead_source_description: "Free Report: Why Reviews Matter",
assigned_user_id: "c7ae9971-e133-51a3-c054-4ea0aecc9bf3",
campaign_id: "8c4d8a24-fd3d-e06a-bf56-4f8deb288f9f",
team_id: 1,
team_set_id: "Global",
cl_type_c: "Member",
cl_industry_c: "-Other-",
status: "New"
@spiritbear
spiritbear / www0.conf
Created September 7, 2012 23:09
www0.conf
; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[www0]
; Per pool prefix
; It only applies on the following directives:
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'