Skip to content

Instantly share code, notes, and snippets.

View braidn's full-sized avatar
🏰
Storming

Braden Douglass braidn

🏰
Storming
View GitHub Profile
@braidn
braidn / avatax_sales_receipt.rb
Last active June 26, 2017 15:00
Avatax Sales Receipt Return
{"id"=>313728202, "code"=>"25b54cc0-3f49-4f9a-aac7-174a5ee43f70", "companyId"=>636231, "date"=>"2017-06-26", "paymentDate"=>"1900-01-01", "status"=>"Saved", "type"=>"SalesInvoice", "batchCode"=>"", "currencyCode"=>"USD", "customerUsageType"=>"", "customerVendorCode"=>"mohammed@schaden.co.uk", "exemptNo"=>"", "reconci
led"=>false, "purchaseOrderNo"=>"GLO195104244742", "referenceCode"=>"", "salespersonCode"=>"", "taxOverrideType"=>"None", "taxOverrideAmount"=>0.0, "taxOverrideReason"=>"", "totalAmount"=>1.0, "totalExempt"=>1.0, "totalTax"=>0.0, "totalTaxable"=>0.0, "totalTaxCalculated"=>0.0, "adjustmentReason"=>"NotAdjusted", "adju
stmentDescription"=>"", "locked"=>false, "region"=>"NY", "country"=>"US", "version"=>1, "softwareVersion"=>"17.6.3.5", "originAddressId"=>797558954, "destinationAddressId"=>797558955, "exchangeRateEffectiveDate"=>"2017-06-26", "exchangeRate"=>1.0, "isSellerImporterOfRecord"=>false, "description"=>"Spree Order", "busi
nessIdentificationNo"=>"", "modifiedDate"=>"2017-06-26T14:19:00.323
@braidn
braidn / docker_changing.yml
Created May 28, 2017 01:02
Docker Compose is A Changing.
version: '2'
services:
db:
image: kiasaki/alpine-postgres
volumes:
- ./pgdata:/pgdata
environment:
POSTGRES_DB: some_db
POSTGRES_USER: postgres
PGDATA: /pgdata
@braidn
braidn / api_setup.rb
Created April 3, 2017 17:09
A Sane API Setup For API Requests in Solidus
RSpec.shared_context 'api_setup' do
let!(:user) { create :user }
before :each do
user.generate_spree_api_key!
end
let(:headers) do
{
'Accept' => 'application/json',
= render partial: "mobile_close"
h1 #{t('account.replenishment.title')}
- if spree_current_user.subscriptions.any?
.g-mar--top.g-mar--xs--7
- user_subscriptions = Glossier::UserSubscriptionsSerializer.new(spree_current_user).to_json
glo-subscriptions user-subscriptions="#{user_subscriptions}"
- else
@braidn
braidn / mount.js
Created January 17, 2017 03:06
Vue Test Mount
var vm = new Vue({
template: '<div><test></test></div>',
components: {
'test': ComponentA
}
}).$mount()
@braidn
braidn / address_book#delete
Created January 13, 2017 13:52
Address Delete
DELETE /api/users/1/address_book
+ Request (application/json)
+ Headers
address_id: 1
Accept: application/json
X-Spree-Token: 67d51a299b8db52330748899dd7a225b8ecb511bc5452f00
class SubscriptionMailerPreview < ActionMailer::Preview
def renewal_fail
order = Spree::Order.last
subscription = Spree::Order.last.subscription
raise 'An order and subscription is required in the DB' unless order && subscription
::SubscriptionMailer.renewal_fail(order, subscription)
end
end
module Components
module Home
class Welcome < React::Component::Base # :nodoc:
param :title, type: String
def render
h1 { "Welcome to #{params.title}!" }
end
end
end
h2.account__title Your Subscriptions
- user.subscriptions.each_with_index do |sub, idx|
.subscriptions
.subscriptions__section.text-xs-center
h5.m-b-1 = "Subscriptions ##{idx}
.subscriptions__products
- sub.items.each do |item|
.subscriptions__product
= image_tag item.account_image
@braidn
braidn / keybase.md
Created December 1, 2016 14:44
keybase.md

Keybase proof

I hereby claim:

  • I am braidn on github.
  • I am braidn (https://keybase.io/braidn) on keybase.
  • I have a public key ASDTYgAUneiyJFEnON2c9TPuCwO6OMnfRJ-Zy0wFgZjhYgo

To claim this, I am signing this object: