Skip to content

Instantly share code, notes, and snippets.

@RyanHendricks
RyanHendricks / ubuntu4you.sh
Last active June 27, 2020 18:17
Ubuntu Instance Init #bash
#!/bin/bash
# Usage:
#
# ./ubuntu4you.sh
#
# User must then logout and login upon completion of script
#
# Exit on any failure

Keybase proof

I hereby claim:

  • I am ryanhendricks on github.
  • I am ryanhendricks (https://keybase.io/ryanhendricks) on keybase.
  • I have a public key ASBsAduK-IoaY4ceHojzQ2d4DpKHAQd3hARSOSQu5MpaEwo

To claim this, I am signing this object:

@RyanHendricks
RyanHendricks / portainer.json
Last active September 20, 2017 17:05
portainer.json
[
{
"title": "titra",
"description": "open source time tracking for small companies",
"categories": [
"project-management"
],
"platform": "linux",
"logo": "https://github.com/faburem/titra/raw/master/public/favicons/android-chrome-192x192.png",
"image": "kromit/titra:latest",
@RyanHendricks
RyanHendricks / vcg.txt
Created September 24, 2017 04:08
Vickrey-Clark-Groves (VCG) Auction
The Vickrey-Clark-Groves (VCG) auction
Auctions are often about selling multiple items at the same time
Timber spectrum oil fields etc
But it is often the case that the buyers want only a subset of the items. However,
bidders would like to bid more items than needed
bidders do not want to buy more items than needed.
The Vickrey-Clark-Groves (VCG) auction is the solution to this problem.
B = {1,2,...,n} is the set of bidders
X = {x1,x2,...,xk} is the set of items to be sold.
@RyanHendricks
RyanHendricks / docsify.css
Last active May 16, 2018 14:51
[CSS Snippets] #css
@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");
* {
-webkit-font-smoothing: antialiased;
-webkit-overflow-scrolling: touch;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-text-size-adjust: none;
-webkit-touch-callout: none;
box-sizing: border-box
}
@RyanHendricks
RyanHendricks / Untitled.sol
Created May 17, 2018 17:22
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.16;
// @title VeoEscrow -- trustless escrow smart contract for VEO<->ETH swaps
// @author ryanhendricks@gmail.com
/**
* This escrow contract uses a similar mechanism as the MAD escrow protocol.
* MAD = mutually assured destruction. The significance of this title is that
* both the buyer and seller are disincentivized to cheat since neither would
* be able to take actions that would harm the other party without also harming
* themselves to an equal extent.
@RyanHendricks
RyanHendricks / v0.3
Created May 23, 2018 21:22
VeoEscrow.sol
pragma solidity ^0.4.23;
// @title VeoEscrow -- trustless escrow smart contract for VEO<->ETH swaps
// @author ryanhendricks@gmail.com
/**
* This escrow contract uses a similar mechanism as the MAD escrow protocol.
* https://pbs.twimg.com/media/DcsJhB7VQAA-kHx.jpg?name=orig
* www.particl.io
*
* MAD = mutually assured destruction. The significance of this title is that
@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;
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);
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)