Skip to content

Instantly share code, notes, and snippets.

@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@VictorTaelin
VictorTaelin / ethereum_delayed_computations.md
Last active April 12, 2018 16:42
Make Ethereum massively scalable today with delayed computations

Make Ethereum massively scalable today with delayed computations

Suppose you're writing a contract which involves a huge amount of participants. As an example, think of an online, blockchain-based Trading-Card Game with tournaments. How would you program a playCard function? You might be thinking of something like this:

function playCard(uint player, uint card){
    ...
    else if (card == PROFESSOR_OAK){
        // shuffles the player's hand on his deck
 shuffleHand(player)
@axic
axic / standardaccount.sol
Last active June 19, 2022 20:26
EIP101 Standard Account code in Solidity
//
// Implementation of the standard account contract as per EIP101 (Cryptocurrency
// abstraction). See: https://github.com/ethereum/EIPs/issues/28
//
// Written by Alex Beregszaszi, use under the MIT license.
//
contract StandardAccount {
uint256 nextSequence = 1;

Frontier technical checklist: (FORK ME)

  • Build Geth release 1.0.0
    • git clone https://github.com/ethereum/go-ethereum.git; cd go-ethereum
    • git checkout release/1.0.0
    • make geth
  • Clean out old test net relics (export ETH=<data dir> default data dir on OS X ~/Library/Ethereum, Linux ~/.ethereum)
    • rm -rf $ETH/{blockchain,state,extra}
    • Make a backup of your old keys cp -r $ETH/keystore /path/to/backup/keystore.backup
  • Craft the genesis block
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 9, 2023 22:47
React (Virtual) DOM Terminology
@gavinandresen
gavinandresen / BlockPropagation.md
Last active March 14, 2023 09:45
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

@ryanxcharles
ryanxcharles / stealth.md
Last active June 14, 2023 13:35
Stealth Addresses, Transactions and Messages

Stealth Addresses, Transactions and Messages

Normal bitcoin addresses cannot be published in public without losing all privacy, since all transactions to that address can be seen by anybody. Stealth addresses let us publish an address in public which can be used by payers to derive a new address that the payee has access to, but no one else knows is associated with the stealth address. The trick is that the payer must use a nonce to derive the address paid to, and this nonce must be delivered to the payee so they know how to recover the funds. This nonce can be delivered in the transaction, so that no separate channel is required to communicate the nonce.

The same technology can also be used to construct new public keys to send encrypted messages to.

We will discuss four methods:

  1. The simplest form of stealth addresses, which has some drawbacks that can improved upon.
@Uroc327
Uroc327 / autoswap_wmctrl.vim
Last active January 1, 2016 10:49 — forked from dprelec/autoswap_linux.vim
This is a version of autoswap_mac.vim from Damian Conway's vim talk that works (or at least tries to) with wmctrl. This does not depend on any stupid titlestrings for vim. Instead it fetches the pid for the swap file and brings the associated window up.
" Vim global plugin for automatin response to swapfiles (from autoswap_mac.vim from Damian Conway)
" Last Change: 2013 Dec 25
" Maintainer: Constantin Runge <uroc327@cssbook.de>
" License: other
if exists("loaded_autoswap")
finish
endif
let loaded_autoswap = 1