Skip to content

Instantly share code, notes, and snippets.

@nick
nick / scrape_stat
Created August 14, 2008 23:08
Save a stat to an active record database
#!/usr/bin/ruby
require 'rubygems'
require 'open-uri'
require 'hpricot'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "mysql", :host => "127.0.0.1", :database => "db", :username => "user", :password => "pass"
)
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
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
@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
(var| ) ([a-zA-Z_]+) *= *require\('([^']+)'\)(;|,)
import $2 from '$3';

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:

@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 {
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 / 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;
@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;