Skip to content

Instantly share code, notes, and snippets.

View browniefed's full-sized avatar
🎧
Building

Jason Brown browniefed

🎧
Building
View GitHub Profile
@browniefed
browniefed / gist:5610144
Last active October 10, 2019 22:07
An explanation of TriMet vehicle tracking, and how PDXLiveBus leverages Node.JS/Firebase to create a pseudo real time map.

#PDXLiveBus

This is a quick tutorial. It's a 2 parter, the first part explaining the concept, how I got the data, and other misc things. The second part is going to be technical. I'll walk you through launching your own PDXLiveBus, and then building it from scratch. Hopefully this can help you implemnet one for your own city.

#The Concept The concept was actually built from SFLiveBus and I just happened to see it and said I could do that. It also helped that I took TriMet and was a little frustrated in that the bus was always late and all I ever wanted to know was where it was at.

#The Vehicles

@browniefed
browniefed / gist:5855005
Created June 25, 2013 00:40
Quickbooks web connector write up. This is how the PHP SDK written by Consolibyte operates.
Quickbooks Process
-------------------
1) A QWC file is generated (file generateQWC.php). This creates the XML for the web connector, adds in the username to the qwc file, also writes the username/password to the quickbooks_user database.
2) The top of the server.php builds the global constants, and builds arrays that get passed into the web connector handler/php sdk.
2 a) QB_QUICKBOOKS_MAX_RETURNED is the amount of items that we tell quickbooks to send to us at one time. Limit this to a minimal amount.
2 b) Then we set up priorities (ie.QB_PRIORITY_CUSTOMER_IMPORT, QB_PRIORITY_INVOICE_IMPORT, etc). The higher the number means that this queue item will get run before the lower numbers.
This comes in handy when you are doing a customer import, and then an invoice import that has to link all invoices to customers. Setting customer import ot
higher than the invoice import will ensure that all customers are imported first.
2 c) $map variable: This links all the SDK functions to PHP functions. These obj
@browniefed
browniefed / Replacing ExtJS with Ractive.js = Awesome.md
Last active January 2, 2016 03:29
Slowly replacing ExtJS with Ractive.js + AMD modules.

##Jama and Ractive.js

Jama has been originally focused on hiring full stack/Java developers. As of May 2012 the first full time front end developer was hired, and I was hired shortly after in July. Jama is mostly a monolithic ExtJS application which is great if you know nothing about front end development and want something up relatively quickly and easily and do not understand how to build structure your own HTML/CSS well.

Our goal was to replace ExtJS but rebuilding the application from the ground up was not an option. So we devised a plan to utilize Ext Containers that would simply render on the page and allow us to use whatever we wanted in them. This allows us to start granular and slowly start replacing larger and larger Ext components.

Another part of the application was already built with AMD modules so in order to encourage module reuse we extend Ext container, and implement a few methods to pull in an AMD module, pass in configuration data that may be still coming from the Ext world, bind to nec

<div class="jui-grid table {{css}}">
<div class="grid-row header">
{{#columns}}
<div class="js-column-{{field}} grid-column grid-column-{{field}} {{#hidden}}hidden{{/hidden}}">
<div class="grid-column-inner">
{{{label}}}
</div>
</div>
{{/columns}}
</div>
[{"active":true,"childDocumentType":{"description":"","display":"Feature","displayPlural":"Features","documentTypeKey":"FEAT","facets":[{"documentTypeId":23,"facet":"HISTORY","isSyncedFacet":false},{"documentTypeId":23,"facet":"ACTIVITIES","isSyncedFacet":false},{"documentTypeId":23,"facet":"URLS","isSyncedFacet":false},{"documentTypeId":23,"facet":"RELATIONSHIPS","isSyncedFacet":false},{"documentTypeId":23,"facet":"ATTACHMENTS","isSyncedFacet":false},{"documentTypeId":23,"facet":"SYNCHRONIZED_ITEMS","isSyncedFacet":false},{"documentTypeId":23,"facet":"TAGS","isSyncedFacet":false}],"fieldList":[],"id":23,"image":"website_blue.png","refId":2,"scopeId":2},"createdBy":{"firstName":"Sample","id":5,"lastName":"User","name":"Sample User","userName":"sample"},"createdDate":"2012-10-08T23:52:04.000Z","currentVersionDocumentActive":true,"description":"<p style=\"margin:0pt\"><span >All detail</span><span >s about scheduling patients.</span></p>","documentKey":"CP-FLD-1","documentType":{"category":"SECTION","display":"
[{"actualDataType":"string","category":2,"controlTypeId":4,"dataType":"string","dataTypeId":2,"documentFieldId":1,"enumType":"","field":"documentKey","hidden":false,"id":255,"isSynchronizeField":false,"isWorkflowField":false,"label":"ID","mappedForImport":false,"readOnly":true,"required":true,"sortOrder":6,"triggerSuspect":false,"userConfigurable":true,"template":"<a href=\"\" on-click=\"openItemTab\" data-field=\"id\">{{<!-- ~~COLUMN_FIELD_PLACEHOLDER~~ -->}}</a>"},{"actualDataType":"ItemType","category":2,"custom":false,"dataType":"Lookup","dataTypeId":14,"documentFieldId":117,"enumType":"","field":"documentType","hidden":false,"id":253,"isSynchronizeField":false,"isWorkflowField":false,"label":"Item Type","mappedForImport":false,"options":[{"description":"","display":"Feature","displayPlural":"Features","documentTypeKey":"FEAT","facets":[{"documentTypeId":23,"facet":"RELATIONSHIPS","isSyncedFacet":false},{"documentTypeId":23,"facet":"TAGS","isSyncedFacet":false},{"documentTypeId":23,"facet":"URLS","isSynce
[{"actualDataType":"string","category":2,"controlTypeId":4,"dataType":"string","dataTypeId":2,"documentFieldId":1,"enumType":"","field":"documentKey","hidden":false,"id":255,"isSynchronizeField":false,"isWorkflowField":false,"label":"ID","mappedForImport":false,"readOnly":true,"required":true,"sortOrder":6,"triggerSuspect":false,"userConfigurable":true,"template":"<a href=\"\" on-click=\"openItemTab\" data-field=\"id\">{{<!-- ~~COLUMN_FIELD_PLACEHOLDER~~ -->}}</a>"},{"actualDataType":"ItemType","category":2,"custom":false,"dataType":"Lookup","dataTypeId":14,"documentFieldId":117,"enumType":"","field":"documentType","hidden":false,"id":253,"isSynchronizeField":false,"isWorkflowField":false,"label":"Item Type","mappedForImport":false,"options":[{"description":"","display":"Feature","displayPlural":"Features","documentTypeKey":"FEAT","facets":[{"documentTypeId":23,"facet":"RELATIONSHIPS","isSyncedFacet":false},{"documentTypeId":23,"facet":"TAGS","isSyncedFacet":false},{"documentTypeId":23,"facet":"URLS","isSynce
==79899== Memcheck, a memory error detector
==79899== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==79899== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==79899== Command: /usr/local/bin/node node_modules/.bin/mocha test
==79899== Parent PID: 58851
==79899==
--79899--
--79899-- Valgrind options:
--79899-- -v
--79899-- --tool=memcheck
==83043== Memcheck, a memory error detector
==83043== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==83043== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==83043== Command: /usr/local/bin/node node_modules/.bin/mocha test
==83043== Parent PID: 80637
==83043==
--83043--
--83043-- Valgrind options:
--83043-- -v
--83043-- --tool=memcheck
{
"MSFT":[
{
"date":"Jan 2000",
"value":39.81
},
{
"date":"Feb 2000",
"value":36.35
},