Skip to content

Instantly share code, notes, and snippets.

View gist:71ffb855369d70ec023307da5acdf9b6
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461017c578063173825d9146101dc57806320ea8d86146102125780632f54bf6e146102325780633411c81c1461028057806354741525146102d75780637065cb4814610318578063784547a71461034e5780638b51d13f146103865780639ace38c2146103ba578063a0e67e2b146104b5578063a8abe69a1461052a578063b5dc40c3146105cc578063b77bf6001461064f578063ba51a6df14610675578063c01a8c8414610695578063c6427474146106b5578063d74f8edd1461074b578063dc8452cd14610771578063e20056e614610797578063ee22610b146107ec575b61017a5b6000341115610177573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b565b005b341561018457fe5b61019a600480803590602001909190505061080c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e457fe5b610210600480803573ffffffffffffffffffffffffffffffffff
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 = Token.at(address)
// tokenInstance.buy({ 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: https://ddx-demo.optimum.network (view in incognito window or something)
Pros:
* 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
0x9b2a963F372EaD8CB57D455FB39101D57Bb6E382
@bwheeler96
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() {