Skip to content

Instantly share code, notes, and snippets.

View jplew's full-sized avatar

JP Lew jplew

View GitHub Profile
@jplew
jplew / FlurksMarket.sol
Created August 30, 2022 23:59
on-chain market
contract FlurksMarket is Context, ReentrancyGuard, Pausable, Ownable {
IERC721 flurksContract; // instance of the Flurks contract
struct Offer {
bool isForSale;
uint flurkID;
address seller;
uint minValue; // in ether
address onlySellTo;
}
@jplew
jplew / Archetype.sol
Last active July 25, 2022 06:43
ERC721A with affiliate marketing minting
// SPDX-License-Identifier: MIT
// Archetype v0.2.0
//
// d8888 888 888
// d88888 888 888
// d88P888 888 888
// d88P 888 888d888 .d8888b 88888b. .d88b. 888888 888 888 88888b. .d88b.
// d88P 888 888P" d88P" 888 "88b d8P Y8b 888 888 888 888 "88b d8P Y8b
// d88P 888 888 888 888 888 88888888 888 888 888 888 888 88888888
// d8888888888 888 Y88b. 888 888 Y8b. Y88b. Y88b 888 888 d88P Y8b.
~/Sites/projects/melange » esy -v -v -v jplew@JPs-MacBook-Pro
debug checkStaleness /Users/jplew/Sites/projects/melange/esy.lock/index.json: false
debug checkStaleness /Users/jplew/Sites/projects/melange/esy.json: true
debug cache is stale, discarding
debug reading project cache: 20.388842ms
debug fetching metadata path:./esy.json
debug not an override /Users/jplew/Sites/projects/melange: error: no such field: source
debug solve config: { Config.installCfg =
{ Config.sourceArchivePath = None;
jplew@DESKTOP-ELKO2NK:~/Sites/projects/melange$ esy -v -v -v
debug checkStaleness /home/jplew/Sites/projects/melange/esy.json: false
debug checkStaleness /home/jplew/Sites/projects/melange/esy.lock/index.json: false
debug using cache
debug reading project cache: 11.265993ms
info esy 0.6.8 (using esy.json)
debug SolutionLock.ofPath /home/jplew/Sites/projects/melange/esy.lock
debug SolutionLock.ofPath /home/jplew/Sites/projects/melange/esy.lock
info using ocaml@4.12.0
debug resolving melange@github:melange-re/melange
@jplew
jplew / error2.sh
Created June 9, 2020 02:37
esy build errors
$ esy x Fetch
File "dune-project", line 5, characters 11-14:
5 | (using fmt 1.2)
^^^
Warning: Version 1.2 of integration with automatic formatters is not
supported until version 1.11 of the dune language.
There are no supported versions of this extension in version 1.0 of the dune
language.
# Unformatted Error Output:
@jplew
jplew / err.sh
Created June 9, 2020 01:43
error logs from esy build
$ esy b dune exec bin/fetch.exe
info building @opam/piaf@github:anmonteiro/piaf:piaf.opam#7f6e491dc@d41d8cd9
error: build failed with exit code: 1
build log:
# esy-build-package: building: @opam/piaf@github:anmonteiro/piaf:piaf.opam#7f6e491dc
# esy-build-package: pwd: /Users/jplew/.esy/3/b/opam__s__piaf-dcdb3bb3
# esy-build-package: running: 'dune' 'build' '-p' 'piaf' '-j' '4'
ocamlc lib/.piaf.objs/byte/piaf__Util.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /Users/jplew/.esy/3___________________________________________________________________/i/ocaml-4.6.1000-a4275564/bin/ocamlc.opt -w -40 -g -bin-annot -I lib/.piaf.objs/byte -I /Users/jplew/.esy/3___________________________________________________________________/i/ocaml-4.6.1000-a4275564/lib/ocaml/threads -I /Users/jplew/.esy/3___________________________________________________________________/i/opam__s__angstrom-opam__c__0.14.1-f5362997/lib/angstrom -I /Users/jplew/.esy/3_________________________________________________________
@jplew
jplew / comparison_to_ocaml.md
Created June 3, 2020 01:05
Reason to OCaml syntax comparison
title
Comparison to OCaml

If you come from OCaml or are a newcomer reading a tutorial written on OCaml, this guide's for you! But don't forget that reason-tools can convert between OCaml and Reason syntax on the fly.

Comments

OCaml Reason
title
Converting from OCaml

Converting a project from OCaml to Reason is straightforward and doesn't require semantic changes. However, there are a few build setup and miscellaneous changes required.

Makefile

If your build system executes explicit build commands, then the easiest way to

@jplew
jplew / logs
Created January 27, 2020 00:44
serverless log
Downloading 1102 deployment files...
Installing build runtime...
Build runtime installed: 538.617ms
Installing build runtime...
Looking up build cache...
Build runtime installed: 716.592ms
Installing dependencies...
Installing build runtime...
Looking up build cache...
Build runtime installed: 859.430ms
@jplew
jplew / logs
Last active January 7, 2020 01:41
CI logs
Running with gitlab-runner 12.1.0 (de7731dd)
on uriel c86c7e91
Using Docker executor with image cypress/base:10 ...
Pulling docker image cypress/base:10 ...
Using docker image sha256:e953bc6b70f097730451eb5c33c05a18a7471f1c2cd840e5923224eefa064cdd for cypress/base:10 ...
Running on runner-c86c7e91-project-326-concurrent-0 via ip-10-0-31-218...
Fetching changes...
Reinitialized existing Git repository in /builds/ops/www/.git/
From https://git.cto.ai/ops/www
* [new ref] refs/pipelines/56908 -> refs/pipelines/56908