Skip to content

Instantly share code, notes, and snippets.

View raddrick's full-sized avatar
🎯
Focusing

Rick Graham raddrick

🎯
Focusing
View GitHub Profile
@raddrick
raddrick / Erc20.sol
Created August 14, 2018 17:17
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=true&gist=
pragma solidity ^0.4.2;
contract Erc20 {
uint public _totalSupply;
function balanceOf(address who) public constant returns (uint);
function allowance(address owner, address spender) public constant returns (uint);
function transfer(address to, uint value) public returns (bool ok);
function transferFrom(address from, address to, uint value) public returns (bool ok);
function approve(address spender, uint value) public returns (bool ok);
@raddrick
raddrick / gist:5556376
Created May 10, 2013 18:25
rvhs form results
{
"data": {
"general_patient_type": "No",
"general_wsib": "No",
"general_language": "E",
"general_first_name": "Rick",
"general_middle_name": "Roland",
"general_last_name": "Graham",
"general_sex": "M",
"general_dob_day": "3",
$('html').find('body').bind('mouseover', function() {
//$('html').find('body').bind('load', function() { // this binding didn't work
var age = Age();
if (age != 0 && !age)
age = '';
$('#form_general_age').val(age);
window.displayGuarantorSection(age);
});
field_type :address_type_check do
field :self do
type :text_field, :size => 25, :maxlength => 25
end
validates :logic => lambda{|field|
errors.add(field_name, "Must have street names and numbers, and no groups of 3 consecutive letters. ") unless ((get_value.length>1) && (get_value.split(" ").count>1) && (get_value.split(/(\D)\1\1/).join == get_value) )
# (get_value.length>1)
# && (get_value.split(" ").count>2)
# && (get_value.split(/(.)\1\1/).join != get_value)
}
field_type :optional_name_check do
field :self do
type :text_field, :minlength=>0
end
validates :logic=>lambda{ |field|
if (get_value.length==1) || ((get_value.split(/(.)\1\1/).join != get_value) || (get_value.split(/[@#\$%&*_;:"+=.,<>?\\\}\{\^\(\)\]\[]/).join != get_value )) && (get_value.length >1)
errors.add(field_name, "Only alphabetic, not 3 consecutive identical, longer than 1 character.")
end
} , :allow_blank=>true
end
@raddrick
raddrick / gist:16c965094325aa274a74
Created March 4, 2015 03:17
olive oils to look for
the following brands as having met their standards for being true extra virgin olive oil.
Corto Olive
California Olive Ranch
Kirkland Organic
Lucero (Ascolano)
McEvoy Ranch Organic
Pompeian
- See more at: http://cdn.eatlocalgrown.com/10-fake-olive-oil.html#sthash.e7jgVqAE.dpuf
“Children are wonderfully confident in their own imaginations. Most of us lose this confidence as we grow up.”
Sir Ken Robinson
"The glory of creation is in its infinite diversity."
"And in the way our differences combine to create meaning and beauty."
-- Dr. Miranda Jones and Spock, "Is There in Truth No Beauty?",
stardate 5630.8
“I am strong because I've been weak. I am fearless because I've been afraid. I am wise because I've been foolish.”
Unknown
require 'minitest/mock'
require 'minitest/unit'
require 'date'
MiniTest::Unit.autorun
class TestMailPurge < MiniTest::Unit::TestCase
class MailPurge
def initialize(imap)
@imap = imap
@raddrick
raddrick / item.json
Created March 11, 2014 22:28
I use this to implement svg templating
{
id: item[0],
date: item[1],
message: item[2],
commiter: item[3],
branch: item[4],
x: 0,
y: 0,
height: 0,
width: 0