Skip to content

Instantly share code, notes, and snippets.

Going back to the basics, really. Words on the printed page.

Koshik Raj koshikraj

Going back to the basics, really. Words on the printed page.
View GitHub Profile
giladHaimov / BasicERC20.sol
Last active Feb 20, 2021
Basic ERC20 implementation
View BasicERC20.sol
pragma solidity ^0.4.19;
contract ERC20Basic {
string public constant name = "ERC20Basic";
string public constant symbol = "BSC";
uint8 public constant decimals = 18;
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
maheshmurthy / Voting.sol
Last active Jul 9, 2020
Simple solidity contract to vote for a candidate and see the results
View Voting.sol
pragma solidity ^0.6.4;
// We have to specify what version of compiler this code will compile with
contract Voting {
/* mapping field below is equivalent to an associative array or hash.
The key of the mapping is candidate name stored as type bytes32 and value is
an unsigned integer to store the vote count
mapping (bytes32 => uint256) public votesReceived;
i3visio /
Created Aug 9, 2016 is a clean implementation of a "proof of work" library for Python.
# ----------------------------------------------
# Hashcash implementation
# ----------------------------------------------
Hashcash is a "proof of work."
>>> import sha
>>>'denmark2890CF').hexdigest() '000000cf89643370c24e413ec0886ab92bd7f6e8'

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."

rxaviers / gist:7360908
Last active Feb 25, 2021
Complete list of github markdown emoji markup
View gist:7360908


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
kitek / gist:1579117
Created Jan 8, 2012
NodeJS create md5 hash from string
View gist:1579117
var data = "do shash'owania";
var crypto = require('crypto');