Skip to content

Instantly share code, notes, and snippets.

View jsonMartin's full-sized avatar

Jason Martin jsonMartin

View GitHub Profile
@jsonMartin
jsonMartin / ghub.lua
Last active September 13, 2023 21:12
ghub lua bindings for gestures (give g-hub mice similar features to mx mice)
--[[
**********
Updated Author: jsonMartin
Original Author: Mark van den Berg
Version: 1.0
Date: 09-13-2023
**********
Updated:
- Updated Gesture button to work with button G9, and to work with option keys
@jsonMartin
jsonMartin / rate-limiter-deno-example.ts
Created February 23, 2023 01:49
How to rate limit in Deno Serverless scripts using "Rate Limiter Flexible" library
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';
import { RateLimiterMemory } from 'https://dev.jspm.io/rate-limiter-flexible';
const rateLimiter = new RateLimiterMemory({
points: 2, // points available, resets after duration
duration: 10, // in seconds
});
console.log('Rate Limiter Test');
@jsonMartin
jsonMartin / Robotic.sol
Last active November 11, 2021 03:45
Robotic.sol
contract Robotic {
// Each uint is tokenID in Items contract
// This Psuedocode example not optimized for memory, but can select smaller uint data types to conserve memory?
struct Robot { // uint refers to ERC-1155 tokenId
uint head;
uint leftArm;
uint rightArm;
uint legs;
uint torso;
mapping(uint => string) public itemType;
@jsonMartin
jsonMartin / README.txt
Created September 18, 2021 05:41
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@jsonMartin
jsonMartin / README.txt
Created September 17, 2021 22:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@jsonMartin
jsonMartin / README.txt
Created September 17, 2021 01:38
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@jsonMartin
jsonMartin / README.txt
Created September 17, 2021 01:37
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@jsonMartin
jsonMartin / contracts...Lottery.sol
Created September 9, 2021 01:27
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0 <0.9.0;
contract Lottery {
address payable[] public players;
address public manager;
constructor() {
manager = msg.sender;
@jsonMartin
jsonMartin / README.txt
Created September 9, 2021 01:26
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS