Skip to content

Instantly share code, notes, and snippets.

View nanthanwa's full-sized avatar

Nan Thanwa nanthanwa

  • Chiang Mai, Thailand
View GitHub Profile
@nanthanwa
nanthanwa / quixoticMultiMint.sol
Created June 11, 2022 18:55 — forked from yoyoismee/quixoticMultiMint.sol
quixotic multi mint
// SPDX-License-Identifier: MIT
// author: yoyoismee.eth
pragma solidity 0.8.14;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
// @notice - free mint that allow contract to mint might not be the best idea ?
// @dev maybe you should add something like requrie(msg.sender == tx.origin) ?
// yeah not sure if this intended. but you know that 5 is not the limit right? I cound just mint up to the gas limit.
// I'll reach out to the creator to see if she want it back. but yeah maybe be more careful next time quixotic team.
users = await UserMobile.aggregate([
{
$match: query,
},
{
$lookup: { from: 'userpackages', localField: 'userPackage', foreignField: '_id', as: 'userPackage' },
},
{
$lookup: { from: 'dates', localField: '_id', foreignField: 'owner', as: 'activeDate' },
},
describe("OneClickMint", () => {
let contract;
beforeEach(async () => {
contract = await deployContract();
});
describe("# Minting with TCR 0.5", () => {
beforeEach(async () => {
await contract.setTCR("0.5");
#------------------------------------------------------------------------------
# solidity.rb
#
# Homebrew formula for solidity. Homebrew (http://brew.sh/) is
# the de-facto standard package manager for OS X, and this Ruby script
# contains the metadata used to map command-line user settings used
# with the 'brew' command onto build options.
#
# Our documentation for the solidity Homebrew setup is at:
#

Keybase proof

I hereby claim:

  • I am nanmcpe on github.
  • I am thanwa (https://keybase.io/thanwa) on keybase.
  • I have a public key whose fingerprint is B362 4538 AC34 4D9D A4B0 61A0 E39E CB8A FA78 040B

To claim this, I am signing this object:

@nanthanwa
nanthanwa / docker-ganache
Created August 27, 2019 10:41
docker-compose.yml for ganache-cli
version: '3.3'
services:
ganache-cli:
container_name: ganache-cli
image: trufflesuite/ganache-cli:latest
ports:
- 8545:8545
restart: always
@nanthanwa
nanthanwa / sonarqube-docker-compose.yml
Created July 1, 2019 05:17 — forked from Warchant/sonarqube-docker-compose.yml
docker-compose file to setup production-ready sonarqube
version: "2"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
GRPC REST
Protocol Buffers - smaller and faster JSON - text ased - slower and bigger
HTTP/2 (lower latency) - from 2015 HTTP/1.1 (higher latency) from 1997
Bidirectional & Async Client => Server requests only
Stream Support Request/ Response support only
API Oriented - What (no constraints - free design) CRUD Oriented (Create - Retrive - Update - Delete / GET POST PUT DELETE)
Code Generation through Protocol Buffers in any language 1st class citizen Code feneratiion through OpenAPI / Swagger (add-on) - 2nd class citizen
RPC Based - gRPC does the plumbing for us HTTP verbs based - we have to write the plumbing or use a 3rd party library

Keybase proof

I hereby claim:

  • I am nanthan on github.
  • I am thanwa (https://keybase.io/thanwa) on keybase.
  • I have a public key ASDoD4Gzws5CklvWp_XI2fcCbpphX1PBna7U2Lt1zp0moQo

To claim this, I am signing this object:

@nanthanwa
nanthanwa / README.md
Created May 23, 2017 16:54 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation