Skip to content

Instantly share code, notes, and snippets.

View dievardump's full-sized avatar

Simon Fremaux dievardump

View GitHub Profile
@joejordan
joejordan / seaportValidatorErrors.ts
Created June 23, 2023 20:15
Seaport Order Validator -- Convert SeaportValidator Errors and Warnings into a readable error message
/**
* Converts a SeaportValidator error/warning code to a human readable string
* @param code number indicating the error/warning code
* @returns readable string
*/
export function getErrorMessage(code: number): string {
switch (code) {
case 100:
return "Invalid order format. Ensure offer/consideration follow requirements";
case 200:
@jackrugile
jackrugile / calc.js
Last active January 8, 2019 15:38
Some common calculation helpers I use in a lot of my demos and games.
class Calc {
/*
------------------------------------------
| rand:float - returns random float
|
| min:number - minimum value
| max:number - maximum value
|
| Get a random float between two values
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE