Skip to content

Instantly share code, notes, and snippets.

View drahosistvan's full-sized avatar

Istvan Drahos drahosistvan

View GitHub Profile
@sonnygauran
sonnygauran / database-tables-size.sql
Created February 5, 2017 12:27
Show current database's table sizes in descending order. Usually ran inside Sequel Pro Based on http://stackoverflow.com/questions/9620198/how-to-get-the-sizes-of-the-tables-of-a-mysql-database.
SET @table=(SELECT DATABASE());
select @table;
SELECT
table_schema as `Database`,
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = @table
ORDER BY (data_length + index_length) DESC;
@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