Skip to content

Instantly share code, notes, and snippets.

@zh
zh / bcmr.json
Last active April 25, 2023 13:11 — forked from mr-zwets/bcmr.json
falcon tbch token
{
"$schema": "https://cashtokens.org/bcmr-v2.schema.json",
"version": { "major": 0, "minor": 1, "patch": 1 },
"latestRevision": "2023-04-25T21:45:00.000Z",
"registryIdentity": {
"name": "cash token",
"description": "self-published cash token on chipnet",
"time": { "begin": "2023-04-25T20:58:08.000Z" }
},
"identities": {
@zh
zh / marketplace.sol
Created March 4, 2022 15:38 — forked from dabit3/marketplace.sol
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {
/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
* limitations, these need to be populated by the target contract, so the
* dispatcher knows how many bytes of data to return from called functions.
@zh
zh / webpacker_rails.md
Created March 19, 2020 08:34 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails

Fast Clojure Hello World Using GraalVM On Mac

Performance

Version Command Time (seconds)
Java time java -jar target/fastclj-1.0-standalone.jar 1.354
GraalVM time ./fastclj-1.0-standalone 0.014

Details

@zh
zh / learn.lua
Last active August 29, 2015 14:19 — forked from tylerneylon/learn.lua
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
require 'net/http'
class HttpClient
def initialize(base_url, username = nil, password = nil)
@base_url = base_url
@username = username
@password = password
end
def get(path, headers = {})
#!/usr/bin/env python
# encoding: utf-8
"""
movie_recommender.py
Created by Thomas Cabrol on 2012-04-06.
Copyright (c) 2012 __MyCompanyName__. All rights reserved.
"""
import csv
@zh
zh / polycorn.md
Created October 22, 2013 02:48 — forked from octplane/polycorn.md

Life and death of Unicorns

The introduction of our Unicorn management tool, Polycorn.

jump into our train!

Photo by Protohiro from Flickr

At Fotopedia, we use Unicorn to serve our main Rails application. Every day, we restart our application several times, spawning and killing hundred of Unicorns. Managing graceful restarts is a complex task, and requires careful monitoring and command. This article introduces our tool Polycorn, a Unicorn management program.

[[MORE]]