Skip to content

Instantly share code, notes, and snippets.

View gist:71ffb855369d70ec023307da5acdf9b6
View ERC20 token
pragma solidity ^0.4.18;
contract Token {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowed;
uint8 public decimals = 18; // Don't set this to anything other than 18, please
View Interacting with your contract
var abi = [] // Paste your ABI here
var Token = web3.eth.Contract(abi)
var address = '' // Paste your contract address here
var tokenInstance =
//{ value: web3.toWei(1) })
View DigitalOcean_NoVNC_Paste.js
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
View sane-web3-fallback-strategy.js
This is a slightly improved web3 detect and fallback pattern
Used for the experience here: (view in incognito window or something)
* web3 users do not have to wait for window.load event to be fired before loading application script
* non-web3 users will not have to load your app script, which may (like mine) fail completely without global web3
* customizable to whatever user experience you need
View kovan-ether
bwheeler96 / delete-reddit-history.js
Created Sep 22, 2017 — forked from andrhamm/delete-reddit-history.js
Delete reddit comment and post history
View delete-reddit-history.js
// Load user profile page, if using RES scroll so many comments are loaded onto the page
// then enter the following in the browser's developer console.
// it will delete 1 post/comment every 1500ms
var $domNodeToIterateOver = $('.del-button .option .yes'),
currentTime = 0,
timeInterval = 1500;
$domNodeToIterateOver.each(function() {