Skip to content

Instantly share code, notes, and snippets.

@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active November 5, 2024 18:04
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@yorickdowne
yorickdowne / SepoliaWhale.md
Last active July 24, 2024 20:58
Get that sweet Sepolia ETH

Sepolia is now on PoS

As of 2022/7/6, Sepolia has switched to PoS. The window to do some mining has closed.

Testnets after merge (original, old content from here)

It's mid 2022, Ethereum is still PoW and motoring towards merge / PoS. Surviving testnets will be Sepolia - currently PoW - and Goerli. Ropsten will be merged and then deprecated, Rinkeby and Kovan won't be merged.

I want to "get ready" for some Sepolia testing pre- and post-merge. Sepolia will not have a public validator set; testing post-merge will be limited to running applications on it. As Sepolia is PoW, I can actually go mine myself some SepplETH. Here's how.

@yorickdowne
yorickdowne / GethBEHAVE.md
Last active July 22, 2024 16:26
Pruning Geth 1.10.x, 1.11.x, 1.12.x

Note: PBSS in Geth >=1.13.0 removes the need to prune manually.


Old content for reference

Overview

Geth (Go-Ethereum) as of July 2022 takes about 650 GiB of space on a fast/snap sync, and then grows by ~ 14 GiB/week with default cache, ~ 8 GiB/week with more cache.

@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active November 13, 2024 13:40
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@Haseeb-Qureshi
Haseeb-Qureshi / threshold_ecdsa.md
Created October 10, 2018 21:44
Fast Multiparty Threshold ECDSA with Fast Trustless Setup @ CESC

Fast Multiparty Threshold ECDSA with Fast Trustless Setup

Steven Goldfeder

Digital signatures authorize transactions in cryptocurrencies

  • Alice's device, containing her private key, is a single point of failure

Multiparty authentication

  • Instead of having a single device store your key material...
    • You can split it into multiple devices
  • Designed your address as protected by multiple keys
@BjornvdLaan
BjornvdLaan / BLSExample.sol
Last active April 10, 2023 07:49
Verification of BLS signatures and BGLS aggregate signatures in Ethereum
pragma solidity ^0.4.14;
/*
Example of how to verify BLS signatures and BGLS aggregate signatures in Ethereum.
Signatures are generated using https://github.com/Project-Arda/bgls
Code is based on https://github.com/jstoxrocky/zksnarks_example
*/
contract BLSExample {
@vre2h
vre2h / simple-deploy.md
Last active November 8, 2024 13:45
Simple guide for deploying your react app to Github-Pages.
  1. Your package.json file should consist a field homepage:
  "homepage": "https://<github-username>.github.io/<project-repo>"

2.1. Install gh-pages via npm:

 npm i --save-dev gh-pages
@jens1101
jens1101 / data-url.js
Last active October 3, 2024 15:53
Save Blob as file in JavaScript
// In this file we use a data URL to represent a Blob. This basically base64
// encodes the Blob and puts that string in a URL. This has better compatibility
// with old browsers, but is limited to ~2MB.
const blob = getBlobFromSomewhere()
const reader = new FileReader()
reader.onload = function (event) {
const a = document.createElement('a')
a.href = event.target.result
@alex-miller-0
alex-miller-0 / metaNFT.md
Created March 6, 2018 00:41
Meta-Non-Fungible Token

Meta-Non-Fungible Token

Non-fungible tokens (NFTs) are all the rage these days, but their current manifestation (ERC721) is inefficient. It is not possible to move multiple tokens at the same time or package multiple tokens for e.g. deposit into a plasma child chain.

Contract pseudocode

The following is a new design for an NFT token that allows aggregation of assets. The rest of the functionality can be inherited from ERC721.

contract NFT {
 tokens mapping(address =&gt; mapping(bytes32 =&gt; uint));
@subhodi
subhodi / QuickSort.sol
Created December 14, 2017 08:31
Quick sort in Solidity for Ethereum network
pragma solidity ^0.4.18;
contract QuickSort {
function sort(uint[] data) public constant returns(uint[]) {
quickSort(data, int(0), int(data.length - 1));
return data;
}
function quickSort(uint[] memory arr, int left, int right) internal{