Skip to content

Instantly share code, notes, and snippets.

@toddgeist
toddgeist / start.js
Created June 7, 2016 17:14
Using dotenv to load vars when dploying to now. But still keep it out of your repo.
// load as early as possible
if(process.env.NOW){
require('dotenv').config({path:'./.envnow', silent:true});
}else{
require('dotenv').config({silent:true});
}
// now you can deploy with:
//$cp .env .envnow && now && rm -r .envnow
@toddgeist
toddgeist / app.js
Last active April 15, 2016 14:24
feathers.js server composition ( sort of )
// src/app.js
const path = require('path');
const serveStatic = require('feathers').static;
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
@toddgeist
toddgeist / ConnectToQuickbooksOnlineButton.jsx
Created January 30, 2016 19:06
React Component to show ConnectTo Quickbooks Online Button
import React, { PropTypes } from 'react';
/**
* Connect to QBO Button
* @param props
* @returns {XML}
*/
const ConnectToQuickBooksOnlineButton = (props)=>{
const {callbackURL} = props;
@toddgeist
toddgeist / QuickbooksOnlineRetainerReport.js
Last active October 29, 2015 17:39
Getting Retainer Report Data from Quickbooks Online
/*
gets each customer with a postive balance in the Retainer Account
check the endDate Below
*/
var QuickBooks = require('node-quickbooks');
var numeral = require('numeral')
var retainerAccountID = 93; // your account id maybe different
var options = {
@toddgeist
toddgeist / ContactController.js
Last active August 29, 2015 14:24
Running a FileMaker Script with sails-filemaker
/**
* ContactController
*
* @description :: Server-side logic for managing Contacts
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
module.exports = {
/**
@toddgeist
toddgeist / jsonCfs
Last active August 29, 2015 14:16
jsonCFs Example
jsonO (
jsonOp ( "firstName" ; "Todd" ) & jsonOp ( "lastName" ; "Geist" ) &
jsonOp (
"pets" ;
jsonA (
jsonAv (
jsonO ( jsonOp ( "species" ; "dog" ) & jsonOp ( "name" ; "Kona" ) )
) &
jsonAv (
jsonO ( jsonOp ( "species" ; "dog" ) & jsonOp ( "name" ; "Alfie" ) )
@toddgeist
toddgeist / gist:9766463ea17810eb2401
Created December 30, 2014 03:56
creating a massive CSV with node streams
/**
* Created by toddgeist on 12/28/14.
*/
var faker = require('faker');
var stringify = require('csv-stringify');
var uuid =require('uuid');
var moment = require('moment');
var fs = require('fs');
var Readable = require('stream').Readable;
Verifying that +toddgeist is my openname (Bitcoin username). https://onename.io/toddgeist
@toddgeist
toddgeist / 6n1 API mEF
Last active August 29, 2015 14:06
6n1 API mEF
##Introduction
This document will specify the API that will be used to send Tax Returns from the FileMaker based 6n1 to the .NET application that is being built by Benchmark to do the actually eFileing with the Federal mEF system.
FileMaker has a reasonable HTTP client, although it is best to keep things as simple as possible. Complex request types like multi-part forms are more difficult. Its best if we can keep to using only text or json formatted data. Raw binaries are tougher.
The intent is to use a REST like architecture. We may not need to support all of the VERBS for each resource. There isn’t really a need to DELETE a firm for example.
Authentication
We’ll keep this simple and use Basic Auth. There will only be two usernames and password pairs needed. One for “end user” access and one for “admin access”. However, at this point there are no features that require “admin” access. We should just keep that possibility open.
All of 6n1 users will use the same username and password. They will never
@toddgeist
toddgeist / designer.html
Created August 19, 2014 17:38
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;