Skip to content

Instantly share code, notes, and snippets.

View critesjosh's full-sized avatar
🥸

josh crites critesjosh

🥸
View GitHub Profile
@critesjosh
critesjosh / stockAPI.js
Created January 14, 2017 04:46
My API call from my stock exchange app
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();
0x3fD3c54412E4263D65F76563fE7914efc9E85B9b
geth attach ipc:/home/josh/.ethereum/net42/geth.ipc

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:

0x28C952e9E0c5bae016814E9Fbb4ad3841ca6d6B8
@critesjosh
critesjosh / Adoption.sol
Created January 10, 2018 21:52
Truffle pet shop tutorial contract
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 January 15, 2018 16:23
A relay contract for upgradable contracts
contract Relay {
address public currentVersion;
address public owner;
modifier onlyOwner() {
if (msg.sender != owner) {
throw;
}
_
}
@critesjosh
critesjosh / circuit_breaker.sol
Last active January 15, 2018 16:39
Add pausability to a smart contract
pragma solidity ^0.4.10;
contract Pausable {
bool public stopped = false;
address private owner;
modifier isAdmin() {
if(msg.sender != owner) {
revert();
contract Relay {
address public currentVersion;
address public owner;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function Relay(address initAddr) {
// This will not compile
pragma solidity ^0.4.0;
contract X {}
contract A is X {}
contract C is A, X {}
// This is ok