Skip to content

Instantly share code, notes, and snippets.

@RyanHendricks
RyanHendricks / merged.sol
Last active March 17, 2020 14:35
Solidity Distribution
pragma solidity ^0.4.23;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
@RyanHendricks
RyanHendricks / buoys.md
Last active October 9, 2020 15:26
Buoys

NOAA NDBC DATA

5-day plot - Wind Speed, Wind Gust and Atmospheric Pressure

Gulf of Mexico

Texas

Station 42019 (LLNR 1285) - FREEPORT, TX - 60 NM South of Freeport, TX

https://www.ndbc.noaa.gov/plot_wind_pres.php?station=42019&uom=E&time_diff=-4&time_label=EDT" alt="42019" width="640" height="480"

@RyanHendricks
RyanHendricks / gaiad.md
Last active April 25, 2019 15:26
Node Setup Steps
# Update and Upgrade
apt-get update && apt-get upgrade -y

# Install Nginx and Obtain SSL Certs (optional)
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install certbot python-certbot-nginx 
systemctl start nginx
systemctl start nginx.service
pragma solidity >=0.4.0 <0.7.0;
library GetCode {
function at(address _addr) public view returns (bytes memory o_code) {
assembly {
// retrieve the size of the code, this needs assembly
let size := extcodesize(_addr)
// allocate output byte array - this could also be done without assembly
// by using o_code = new bytes(size)
@RyanHendricks
RyanHendricks / bech32.js
Last active February 4, 2020 21:59
decoder
SOURCE ----> https://github.com/sipa/bech32/blob/master/ref/javascript/bech32.js
// Copyright (c) 2017 Pieter Wuille
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@RyanHendricks
RyanHendricks / UnionPoker.sol
Created January 3, 2019 18:33
Union Poker
pragma solidity ^0.5.0;
contract UnionPoker {
struct UnionPokerGame {
bool started; /// has the game started
bool ended; /// has the game ended
uint256 totalBuyIns; /// total of all buy ins
uint256 totalCashOuts; /// total of all cash outs
pragma solidity ^0.4.24;
/// SOURCE: https://raw.githubusercontent.com/yanche/eth_contract_addr_calc/master/contract_addr.sol
library ContractAddrCalculator {
// NOTE this program works as long as nonce is less than 33 bytes
// which is 2**(8*33), almost impossible for a contract to create
// so many contracts, also uint256 is only 32bytes
library(httr)
library(XML)
results = GET("https://en.wikipedia.org/wiki/List_of_cryptocurrencies")
doc = readHTMLTable(doc=content(results, "text"))
View(doc[1])
library(jsonlite)
library(data.table)
response = fromJSON('https://www.cryptocompare.com/api/data/coinlist')
df = data.table::rbindlist(response$Data, fill=TRUE)
pragma solidity ^0.4.23;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
@RyanHendricks
RyanHendricks / gist:178206d2821cafbc94bd0041da21a0b3
Created July 11, 2018 17:30
ShitTokenICO - Find the bug(s)
pragma solidity ^0.4.23;
// There are no compiler errors but what could potentially go wrong here?
contract ShitTokenICO {
// balances of the respective internal accounts
uint256 public founderOneFunds;
uint256 public founderTwoFunds;
uint256 public teamFunds;