Skip to content

Instantly share code, notes, and snippets.

View theinventor's full-sized avatar

Troy Anderson theinventor

View GitHub Profile
@theinventor
theinventor / vendor_purchasing_guide.md
Last active August 27, 2015 18:36
Vendor Purchasing and Catalog Integrating with RepairShopr

So you want to get your catalog into RepairShopr or integrate automated ordering?

Last Revision: 2015-08-27, Troy

There are 2 primary ways RepairShopr can work with a Vendor (supplier, distributor, etc).

  1. We can maintain a catalog of your available products with SKUs and all the details, and make that available for our users to one-click import.
  2. We can tie into your ordering system so our users can one-click to send their Purchase Orders into your ordering system to generate a live order. (Fully Automated re-ordering is coming very soon too)

Product Catalog

idnexworkrer:
account.setup_locale
(USA) I18n.l(t.created_at.to_date) => "6/22/15"
(UK) I18n.l(t.created_at.to_date) => "22-06-2015"
def localized_created_at
end
def localized_due_date
@theinventor
theinventor / instructions.md
Last active August 29, 2015 14:23
Integrating Domo with our rails app

So - I started out learning that there is a client and server half of the setup, the idp is the Identity Provider, that is the half we were going to be - so domo could check against us.

We grabbed the gem https://github.com/lawrencepit/ruby-saml-idp

And we rolled master back to the version that was the last released gem (known state)

And.. hacked it a bit so we could pass multiple groups and a name: https://github.com/RepairShopr/ruby-saml-idp/commit/07d2df4b61296b67e4bfd6674456cbf0c51174c6

Then, in our app we did mostly what the readme said to do:

@theinventor
theinventor / snippets.html
Created May 30, 2015 13:28
add an account summary to invoices
Use this tag instead of the {{invoice_balance_due}}:
{{customer_open_balance}}
put this right below the section with the first balance due, above the line items table:
<div class="invbody">
<table cellspacing="0" class="invbody-items">
<thead>
@theinventor
theinventor / invoice_template.html
Last active August 29, 2015 14:22
invoice template with account summary area (showing open balances)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>RepairShopr Invoice Template 6</title>
<style type="text/css">html, body {
font-family: Arial, "Arial Unicode", "Arial Unicode MS", Helvetica, sans-serif;
font-size: 12px;
line-height: 16px;
word-wrap: break-word;
[troy@repairshopr-one BackOffice (master *)]$ wget http://admin.repairshopr.com/users/sign_in
--2015-05-20 13:20:55-- http://admin.repairshopr.com/users/sign_in
Resolving admin.repairshopr.com... 162.159.240.103, 198.41.249.102
Connecting to admin.repairshopr.com|162.159.240.103|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://admin.repairshopr.com/users/sign_in [following]
--2015-05-20 13:20:55-- https://admin.repairshopr.com/users/sign_in
Connecting to admin.repairshopr.com|162.159.240.103|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
@theinventor
theinventor / s3cfg
Created May 19, 2015 20:43
s3cfg for grunt deploy
[default]
access_key = REPLACE_ME
add_encoding_exts =
add_headers =
bucket_location = US
cache_file =
cloudfront_host = cloudfront.amazonaws.com
default_mime_type = binary/octet-stream
delay_updates = False
delete_after = False
@theinventor
theinventor / woocommercer.rb
Created May 17, 2015 19:21
This is a quick class to handle talking to woocommerce in ruby. I borrowed the whole thing from here: https://github.com/gurgus/RuWoCo, then updated to v2 and added PUT
class Woocommercer
require "digest/sha1"
require "cgi"
require "json"
require "base64"
require "openssl"
require "net/http"
require "net/https"
attr_accessor :consumer_key, :consumer_secret, :api_url, :is_ssl
@theinventor
theinventor / cloudberry_ruby_client.rb
Last active August 29, 2015 14:20
A super quick draft of a Cloudberry API 2.0 client in ruby
class Cloudberry
attr_accessor :access_token, :base_url, :api_version, :account
def initialize(account)
@api_version = "/api"
@account = account
@access_token = @account.settings.cloudberry_access_token
refresh_token! if have_credentials? && !valid_access_token?
end
<script type="text/javascript">
var tmr;
function onSign()
{
var ctx = document.getElementById('cnv').getContext('2d');
SetDisplayXSize( 500 );
SetDisplayYSize( 100 );
SetJustifyMode(0);