Skip to content

Instantly share code, notes, and snippets.

View tmornini's full-sized avatar

Tom Mornini tmornini

View GitHub Profile
@tmornini
tmornini / 2.0.0-p451
Last active August 29, 2015 13:57
Segfault in Ruby 2.1.0 and 2.1.1, Mac OS X 10.9.2
ruby: 2.0.0-p451 | master *%
v3 $ ./example.rb
./example.rb:14:in `<module:Subledger>': Subledger::BadRequest
from ./example.rb:3:in `<main>'
require 'uri'
require 'reel'
require 'subledger/json'
require 'subledger/uuid'
module Subledger
module Server
class Reel < Reel::Server::HTTP
E, [2014-04-06T12:10:05.837299 #58542] ERROR -- : MyServer crashed!
Reel::StateError: already processing a request
Q) What is Subledger?
A) Subledger is a modern double-entry ledger and financial report API for mobile and web app developers.
Q) What is Subledger's purpose?
A) Subledger's purpose is to give developers the tools to maintain more accurate, detailed and actionable
financial information than they would if they built it themselves.
Q) Is Subledger difficult to use?
A) No. It is easier, less expensive and less risky than building something equivalent. Subledger customers have greatly
simplified their code bases, reduced their operational responsibility, and reduced the latency and complexity of their
@tmornini
tmornini / gist:789d0cf3bccec2cdcf2c
Last active August 29, 2015 14:03
Subledger Getting Started
0) Live in-browser API docs (Swagger)
a) https://api.subledger.com
b) we recommend that you copy/paste all responses for future reference
1) Setup the system
a) Create an Identity via first API operation!
b) Enter key_id and secret in the Security credentials boxes in the upper-right corner of API docs
c) Create an org
d) Create a book
e) Create some accounts (Recommended: Cash, Payables, Shareholder Equity)
v3 $ dev/guard
10:53:00 - INFO - Guard is now watching at '/Users/tmornini/subledger/v3'
[1] guard(main)>
10:53:02 - INFO - Run all
Run options: --seed 37703
# Running:
.....................S..............................S......S................................................S.................................................................................................................................S...S.............................................S....................................................SS...........................................
Using worker: worker-linux-1-2.bb.travis-ci.com:travis-linux-11
system_info
Build system information
Build language: ruby
Build image provisioning date and time
Mon Dec 8 00:37:19 UTC 2014
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Verifying that +tmornini is my openname (Bitcoin username). https://onename.com/tmornini
Block Reward Era BTC/block Year Start BTC BTC Added End BTC BTC % Increase End BTC % of Limit Supply Inflation Rate
0 : 1 : 50.00000000 : 2009.008 : 0.00000000 : 10500000.00000000 : 10500000.00000000 : Inf% : 50.00000006% : Inf%
210000 : 2 : 25.00000000 : 2013.000 : 10500000.00000000 : 5250000.00000000 : 15750000.00000000 : 50.00000000% : 75.00000008% : 10.66819197%
420000 : 3 : 12.50000000 : 2016.993 : 15750000.00000000 : 2625000.00000000 : 18375000.00000000 : 16.66666667% : 87.50000010% : 3.92898776%
630000 : 4 : 6.25000000 : 2020.986 : 18375000.00000000 : 1312500.00000000 : 19687500.00000000 : 7.14285714% : 93.75000010% : 1.73978273%
840000 : 5 : 3.12500000 : 2024.978 : 19687500.00000000 : 656250.00000000 : 20343750.00000000 : 3.33333333% : 96.87500011% : 0.82311468%
1050000 :
@tmornini
tmornini / gist:10551841
Last active November 24, 2015 19:04
Subledger v2 create_and_post JSON body
{
"effective_at": "ISO8601 Date/Time",
"description": "Free form text",
"reference": "URL",
"lines": [
{
"account": "account_id",
"value": {
"type": "debit",
"amount": "10.00"