Skip to content

Instantly share code, notes, and snippets.

@nick
nick / auth.sol
Created March 22, 2019 15:02
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.6+commit.b259423e.js&optimize=false&gist=
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
@nick
nick / Identity.sol
Created October 3, 2018 01:21
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
contract ERC725 {
uint256 constant MANAGEMENT_KEY = 1;
uint256 constant ACTION_KEY = 2;
uint256 constant CLAIM_SIGNER_KEY = 4;
uint256 constant ENCRYPTION_KEY = 8;
@nick
nick / ballot.sol
Created October 3, 2018 01:20
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
contract ERC725 {
uint256 constant MANAGEMENT_KEY = 1;
uint256 constant ACTION_KEY = 2;
uint256 constant CLAIM_SIGNER_KEY = 4;
uint256 constant ENCRYPTION_KEY = 8;
pragma solidity ^0.4.24;
import "./openzeppelin-solidity/ownership/Ownable.sol";
import "./openzeppelin-solidity/token/ERC20/StandardToken";
contract Token is StandardToken, Ownable {
uint256 public constant decimals = 0;
string public constant name = "ERC827 Token";
string public constant symbol = "TOK";
@nick
nick / ERC20.sol
Created August 2, 2018 17:51
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.24;
import "./ERC20Basic.sol";
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {

Keybase proof

I hereby claim:

  • I am nick on github.
  • I am nick_p (https://keybase.io/nick_p) on keybase.
  • I have a public key ASBc5eqtAxgNOJ6SLOrgtL2jMMVIe1Di4iV4L70cVtbaMQo

To claim this, I am signing this object:

(var| ) ([a-zA-Z_]+) *= *require\('([^']+)'\)(;|,)
import $2 from '$3';
@nick
nick / gist:f80aa2b7763ea7254037
Created January 20, 2016 21:34
Find used JS files
webpack --display-modules > files.txt
cut -d ' ' -f 3 files.txt | grep ^\.\/js | sort > used-js.txt
find ./js -name '*.js' | sort > all-js.txt
comm -3 all-js.txt used-js.txt
Feature set:
Load a URL
Drag and Drop
Take Screenshots
Check with reference image
Monitor memory usage
Monitor performance at certain points within code
Report on any hard errors
Report any console warnings
var colors = ['#555', '#666', '#777', '#888', '#999'];
var baseColor = '#eee';
Ext.define('Ext.chart.theme.Fancy', {
extend: 'Ext.chart.theme.Base',
constructor: function(config) {
this.callParent(Ext.apply({
axis: {
fill: baseColor,
stroke: baseColor