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