Skip to content

Instantly share code, notes, and snippets.

View PatrickAlphaC's full-sized avatar
💭
Enabling web3 developers at scale

Patrick Collins PatrickAlphaC

💭
Enabling web3 developers at scale
View GitHub Profile
@alexroan
alexroan / VRFD20.sol
Last active July 12, 2021 01:57
Game of Thrones 20 Sided Dice
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
import "https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/VRFConsumerBase.sol";
import "https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/Owned.sol";
/**
* @notice A Chainlink VRF consumer which uses randomness to mimic the rolling
* of a 20 sided die
* @dev This is only an example implementation and not necessarily suitable for mainnet.
@PatrickAlphaC
PatrickAlphaC / RandomNumberConsumer.sol
Last active June 23, 2021 12:12 — forked from alexroan/RandomNumberConsumer.sol
Random Number Generator. Use this gist as a way to generate a random number in solidity or your EVM compatible smart contracts. If you'd like to deploy it to remix, try this: url: https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&evmVersion=null&gist=f47e4eae5f2ffa7868ef4ecd5bda9044
/** This example code is designed to quickly deploy an example contract using Remix.
* If you have never used Remix, try our example walkthrough: https://docs.chain.link/docs/example-walkthrough
* You will need testnet ETH and LINK.
* - Kovan ETH faucet: https://faucet.kovan.network/
* - Kovan LINK faucet: https://kovan.chain.link/
*/
pragma solidity 0.6.6;
import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol";
// This example code is designed to quickly deploy an example contract using Remix.
pragma solidity 0.6.6;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/master/evm-contracts/src/v0.6/VRFConsumerBase.sol";
contract RandomNumberConsumer is VRFConsumerBase {
bytes32 internal keyHash;
uint256 internal fee;
@PatrickAlphaC
PatrickAlphaC / alpha_vantage_sample.py
Last active January 21, 2020 17:29
Simple Alpha Vantage Startup
import requests
import json
key = 'XXX'
# Get a key from https://www.alphavantage.co/support/#api-key
ticker = 'TSLA'
url = 'https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol={}&apikey={}'.format(ticker, key)
response = requests.get(url)
print(response.json())
@cmatskas
cmatskas / GitDeleteCommands.ps1
Last active September 22, 2022 07:59
Git Delete Branch commands
## Delete a remote branch
$ git push origin --delete <branch> # Git version 1.7.0 or newer
$ git push origin :<branch> # Git versions older than 1.7.0
## Delete a local branch
$ git branch --delete <branch>
$ git branch -d <branch> # Shorter version
$ git branch -D <branch> # Force delete un-merged branches
## Delete a local remote-tracking branch