Skip to content

Instantly share code, notes, and snippets.

@critesjosh
critesjosh / stockAPI.js
Created Jan 14, 2017
My API call from my stock exchange app
View stockAPI.js
function apiCall(currentSymbol) {
var searchTerm;
if (currentSymbol) {
searchTerm = currentSymbol;
} else {
searchTerm = $('#searchTerm').val();
searchTerm = searchTerm.toUpperCase();
}
var url = "http://data.benzinga.com/rest/richquoteDelayed?symbols=" + searchTerm;
$('.loaderImage').show();
View rinkeby2.file
0x3fD3c54412E4263D65F76563fE7914efc9E85B9b
View 42attach.sh
geth attach ipc:/home/josh/.ethereum/net42/geth.ipc
View keybase.md

Keybase proof

I hereby claim:

  • I am critesjosh on github.
  • I am critesjosh (https://keybase.io/critesjosh) on keybase.
  • I have a public key whose fingerprint is 3ECD C2B2 55B9 9DE2 F7E5 03E3 5FC7 B319 582C 852F

To claim this, I am signing this object:

View rinkeby.faucet
0x28C952e9E0c5bae016814E9Fbb4ad3841ca6d6B8
@critesjosh
critesjosh / Adoption.sol
Created Jan 10, 2018
Truffle pet shop tutorial contract
View Adoption.sol
pragma solidity ^0.4.4;
contract Adoption {
address[16] public adopters;
// Adopting a pet
function adopt(uint petId) public returns (uint) {
require(petId >= 0 && petId <= 15);
@critesjosh
critesjosh / Relay.sol
Created Jan 15, 2018
A relay contract for upgradable contracts
View Relay.sol
contract Relay {
address public currentVersion;
address public owner;
modifier onlyOwner() {
if (msg.sender != owner) {
throw;
}
_
}
@critesjosh
critesjosh / circuit_breaker.sol
Last active Jan 15, 2018
Add pausability to a smart contract
View circuit_breaker.sol
pragma solidity ^0.4.10;
contract Pausable {
bool public stopped = false;
address private owner;
modifier isAdmin() {
if(msg.sender != owner) {
revert();
View Relay.sol
contract Relay {
address public currentVersion;
address public owner;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function Relay(address initAddr) {
View gist:2fbace8145e4417ecb99cb9913b92069
// This will not compile
pragma solidity ^0.4.0;
contract X {}
contract A is X {}
contract C is A, X {}
// This is ok