Skip to content

Instantly share code, notes, and snippets.

View rumkin's full-sized avatar
🧠
Getting deeper

Paul Rumkin rumkin

🧠
Getting deeper
View GitHub Profile
@rumkin
rumkin / Readme.md
Last active May 15, 2020 22:15
Ethereum address from a signature.
@rumkin
rumkin / exec.js
Created May 6, 2020 16:38
Utils for LibP2P example
// Usage is node exec.js app.js
// app.js should export default function
import path from 'path'
async function execute(filename) {
const {default: main} = await import(
path.resolve(filename)
)
return main({
@rumkin
rumkin / Readme.md
Last active May 6, 2020 16:40
LibP2P Streams
@rumkin
rumkin / favicon.svg.xml
Last active March 25, 2020 01:57
Favicon SVG
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<text y="100" font-size="100">
😎
</text>
</svg>
@rumkin
rumkin / range.js
Last active March 6, 2020 00:28
Range
function * range(start, end, step = 1) {
if (start < end) {
while (start < end) {
yield start
start += step
}
}
else if (start > end) {
while (start > end) {
start -= step
@rumkin
rumkin / patches.diff
Created March 2, 2020 11:36
Ethereum VM initialize patch
--- new.patch 2020-03-02 14:15:28.000000000 +0300
+++ old.patch 2020-03-02 14:16:08.000000000 +0300
@@ -1,17 +1,17 @@
-From 00bb40d8982cd986a37a8072691060a8b72ce11d Mon Sep 17 00:00:00 2001
+From 054bc49da2332948df9e015d7353a94d3c162d52 Mon Sep 17 00:00:00 2001
From: Pavel Rumkin <dev@rumk.in>
Date: Sat, 22 Feb 2020 09:31:44 +0300
Subject: [PATCH 1/2] Add initialization method to prevent race conditions
---
@rumkin
rumkin / readme.md
Last active February 28, 2020 05:59
Use TestUp with EVM in JS

Run EVM tests with TestUp

This is short explanation of how tests scripts and helpers might look.

evm.spec.js

import {initEvm, checkpoint} from './helpers';

export default ({describe, it, use, each}) => {
@rumkin
rumkin / node-find-tar.sh
Last active April 4, 2020 08:30
Pack node project into tar with find
find-to-tar() {
local IN=${1:-.}
local OUT=${2:-archive.tar.gz}
find $IN -type f ! \( -path '*/node_modules/*' -o -path '*/dist/*' -o -path '*/build/*' \) | tar cvfz $OUT -T -
}
# Example:
# $ find-to-tar . arch.tar.gz
@rumkin
rumkin / Registry.sol
Created February 12, 2020 15:21
🚧[WIP] Simple code registry implementation.
pragma solidity ^0.5.0;
contract Registry {
bytes[] names;
mapping(bytes32 => Package) packages;
struct Package {
bytes name;
address owner;
uint8[] versions;
@rumkin
rumkin / log.sol
Last active January 29, 2020 23:55
pragma solidity >= 0.5.0;
contract Log {
address public owner;
event LogMsg(bytes message);
constructor(address _owner) public {
owner = _owner;
}