Skip to content

Instantly share code, notes, and snippets.

View nickdotht's full-sized avatar
💀
Memento Mori

Nick Rameau nickdotht

💀
Memento Mori
View GitHub Profile
@nickdotht
nickdotht / Get all kiosk sales between date range.sql
Created March 6, 2018 19:38
I use this to pull sales data so we can take care of duplicated sales
SELECT
kiosk.name AS 'Kiosk',
receipt.id as 'Receipt ID',
DATE_FORMAT(receipt.created_date, '%m/%d/%Y') AS Date,
customer_account.id AS 'Customer ID',
customer_account.contact_name AS 'Customer Name',
sales_channel.name AS 'Sales Channel',
receipt_line_item.sku AS 'SKU',
receipt_line_item.quantity 'Qty',
receipt.total_gallons 'Gallons',
@nickdotht
nickdotht / create_country.sql
Last active October 30, 2018 16:45
SEMA - Getting started. Those are the SQL scripts to run on the database to get started quickly with some sample data. You must first run the ones that are in the `database` folder of the project.
INSERT INTO `country` (`id`, `name`) VALUES (1, 'Haiti');
@nickdotht
nickdotht / create_product.sql
Created October 30, 2018 17:12
New product creation
INSERT INTO `product` (`id`, `name`, `sku`, `description`, `category_id`, `price_amount`, `price_currency`, `unit_per_product`, `unit_measure`, `cogs_amount`, `base64encoded_image`) VALUES (2, 'Porridge', 'PO1', '1 bag of Porridge', 2, 24000.00, 'UGX', 1, 'bags', 12000.00, 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4RDyRXhpZgAATU0AKgAAAAgABAE7AAIAAAANAAAISodpAAQAAAABAAAIWJydAAEAAAAaAAAQ0OocAAcAAAgMAAAAPgAAAAAc6gAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@nickdotht
nickdotht / delete-duplicated-receipts.sql
Created December 19, 2018 17:51
This is the SQL that we use at dloHaiti to delete duplicated receipts introduced by the old POS app.
set @kid = 102;
set @start_date = '2018-11-0';
set @end_date = '2018-12-0';
SET SQL_SAFE_UPDATES = 0;
DELETE FROM receipt
WHERE
id IN (SELECT
a.id
@nickdotht
nickdotht / full-dump.sh
Created March 24, 2020 11:39
Commands to dump a MySQL DB without the definer.
mysqldump -h [DB-HOST] --databases [DB-NAME] -u[DB-USER] -p | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > ./[OUTPUT-FILE-NAME].sql
@nickdotht
nickdotht / doulevo-code-of-conduct-discord.md
Last active May 22, 2021 20:54
The Code of Conduct document for the Doulevo Discord server

DOULEVO Code of Conduct

Welcome!

This is the community server for the discussion of the Doulevo development platform.

We want this to be a fun, pleasant, and harassment-free experience for everyone, regardless of gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, or religion. We do not tolerate harassment of participants in any form. Participants asked to stop any harassing behavior are expected to comply immediately.

@nickdotht
nickdotht / solution
Created November 25, 2021 22:01
React/TypeScript: - Cannot find namespace 'XXXXXXX'
This happens when you try to use JSX from a ts file. Make sure your file ends with `.tsx`, not `.ts`.