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 / post.blueprint
Created November 8, 2016 16:49
Post Subscriptions
# POST /api/subscriptions.json
+ Request (application/json; charset=utf-8)
{
"order_number": "R758060012",
"order_token": "c3hVyiLjOhlJAg1YAgFdBw",
"subscription": {
"frequency": 2,
"is_recurring": true
version: '2'
services:
db:
image: kiasaki/alpine-postgres
volumes:
- ./pgdata:/pgdata
ports:
- "5432:5432"
environment:
POSTGRES_DB: greenhouse_development
module Spree
PermittedAttributes.module_eval do
def subscription_attributes
[
:activated_at
]
end
module_function :subscription_attributes
@braidn
braidn / travis.yml
Created October 20, 2016 13:10
Before install for Travis-Ci For Yarn
before_install:
- "export NODE_VERSION=6"
# Build me a Node
- "rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $NODE_VERSION"
# Repo for Yarn
- "sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3"
- "echo 'deb http://dl.yarnpkg.com/debian/ stable main' | sudo tee /etc/apt/sources.list.d/yarn.list"
- "sudo apt-get update -qq"
- "sudo apt-get install -y -qq yarn"
- "yarn install"
@braidn
braidn / Dockerfile
Last active October 4, 2016 16:08
Current Docker Exploration
FROM ruby:2.1.8-alpine
MAINTAINER DW & Braidn <itsallbroken@godynamo.com>
# Env
ENV REFRESHED_AT 2016-09-21
ENV PROJECT_NAME quarterly
ENV REPO_DIR /home/$PROJECT_NAME/repo
ENV GEM_HOME /home/$PROJECT_NAME/gems
ENV ENV_FILE /home/$PROJECT_NAME/repo/.env
ENV BUILD_PACKAGES bash libffi-dev openssl-dev linux-headers zlib-dev readline-dev yaml-dev git curl-dev ruby-dev build-base
ENV RUBY_PACKAGES ruby-io-console ruby-bundler nodejs libxml2-dev libxslt-dev postgresql-dev
RSpec.shared_context 'shopify_shop' do
let(:refund_amount) { 100 }
let(:shopify_payment_method) do
gateway = Spree::Gateway::ShopifyGateway.new
gateway.set_preference(:api_key, ENV.fetch('SHOPIFY_API_KEY'))
gateway.set_preference(:password, ENV.fetch('SHOPIFY_PASSWORD'))
gateway.set_preference(:shop_name, ENV.fetch('SHOPIFY_SHOP_NAME'))
gateway
end
require 'spec_helper'
require 'solidus_retail/order/generate_pos_order'
RSpec.describe SolidusRetail::Order::GeneratePosOrder, type: :model do
include_context 'shopify_shop'
it 'instantiates itself successfully' do
binding.pry
end
end
$(document).ready(function() {
var $footerForm = $('.m-footer-newsletter .mc-embedded-subscribe-form')
var $popupForm = $('.newsletter-popup-inner .mc-embedded-subscribe-form')
if( $footerForm.length > 0) {
initForm($footerForm);
}
if( $popupForm.length > 0) {
initForm($popupForm);
/*
Copyright 2015 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '*',