Skip to content

Instantly share code, notes, and snippets.

Avatar
💀
Memento Mori

Nick Rameau nickdotht

💀
Memento Mori
View GitHub Profile
@nickdotht
nickdotht / doulevo-code-of-conduct-discord.md
Last active May 22, 2021
The Code of Conduct document for the Doulevo Discord server
View doulevo-code-of-conduct-discord.md

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 / full-dump.sh
Created Mar 24, 2020
Commands to dump a MySQL DB without the definer.
View full-dump.sh
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 Dec 19, 2018
This is the SQL that we use at dloHaiti to delete duplicated receipts introduced by the old POS app.
View delete-duplicated-receipts.sql
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
View create_product.sql
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 Oct 30, 2018
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.
View create_country.sql
INSERT INTO `country` (`id`, `name`) VALUES (1, 'Haiti');
@nickdotht
nickdotht / Get all kiosk sales between date range.sql
Created Mar 6, 2018
I use this to pull sales data so we can take care of duplicated sales
View Get all kiosk sales between date range.sql
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 Mar 6, 2018
This is the SQL query that I use to generate operations reports for Xero
View ops-report.sql
SELECT
kiosk.name AS ContactName,
'' AS 'EmailAddress',
'' AS 'POAddressLine1',
'' AS 'POAddressLine2',
'' AS 'POAddressLine3',
'' AS 'POAddressLine4',
'' AS 'POCity',
'Saintard' AS 'PORegion',
'' AS 'POPostalCode',
@nickdotht
nickdotht / README.md
Created Sep 26, 2017 — forked from csswizardry/README.md
Vim without NERD tree or CtrlP
View README.md

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
View React native how to fix INSTALL_FAILED_UPDATE_INCOMPATIBLE
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:
View how to fix watchman error
When building React Native apps on Linux, you might get this error at some point:
The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
Here's how to fix it:
You will need administration privileges at some point!
1. Check for the current value of max_user_watches