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 / 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`.
@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.

When building an adnroid app, you might stumble upon this error:
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE...`. Here's how to fix it:
That's because the app you're trying to test was already installed on the device and the signatures are different now, so it's complaining. The full error will look like something like this:
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.example signatures do not match the previously installed version; ignoring!`
You can see that the package ID is `com.example`, well, simply run this command:
" Lets you press F6 to add the standard 42 header to your file
nnoremap <F6> :Stdheader<CR>
" Sets UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" Disables vi compatibility (emulation of old bugs)
set nocompatible
@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 / 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 / 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 / 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 / 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 / ops-report.sql
Created March 6, 2018 18:12
This is the SQL query that I use to generate operations reports for Xero
SELECT
kiosk.name AS ContactName,
'' AS 'EmailAddress',
'' AS 'POAddressLine1',
'' AS 'POAddressLine2',
'' AS 'POAddressLine3',
'' AS 'POAddressLine4',
'' AS 'POCity',
'Saintard' AS 'PORegion',
'' AS 'POPostalCode',