Skip to content

Instantly share code, notes, and snippets.

Avatar
🖋️
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
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
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
i3visio / hashcash.py
Created Aug 9, 2016
hashcash.py is a clean implementation of a "proof of work" library for Python.
View hashcash.py
# ----------------------------------------------
# hashcash.py: Hashcash implementation
# ----------------------------------------------
"""
Hashcash is a "proof of work."
Example:
>>> import sha
>>> sha.new('denmark2890CF').hexdigest() '000000cf89643370c24e413ec0886ab92bd7f6e8'
View BlockPropagation.md

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
rxaviers / gist:7360908
Last active Feb 25, 2021
Complete list of github markdown emoji markup
View gist:7360908

People

: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
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');
crypto.createHash('md5').update(data).digest("hex");