Skip to content

Instantly share code, notes, and snippets.

View deepdivedylan's full-sized avatar
😹
Because fuzzy! 😻

Dylan McDonald deepdivedylan

😹
Because fuzzy! 😻
View GitHub Profile
@deepdivedylan
deepdivedylan / rospten-nodejs.md
Created May 14, 2018 21:47
Querying Rospten with NodeJS

Querying Rospten with NodeJS

  1. Create a new work directory: mkdir rospten-nodejs
  2. Use that directory: cd rospten-nodejs
  3. Install web3 library: npm install web3
  4. Save the following code to get-balance.js:
let infuraKey = "INFURA API KEY";
let metamaskWallet = "METAMASK WALLET";

Keybase proof

I hereby claim:

  • I am deepdivedylan on github.
  • I am deepdivedylan (https://keybase.io/deepdivedylan) on keybase.
  • I have a public key ASDbt-TOZNFsu3hEZqyOu84xpm9c19qIspx2qltSKFSh4Qo

To claim this, I am signing this object:

@deepdivedylan
deepdivedylan / validate-image.php
Last active June 7, 2016 21:35
Validates Image Uploads in PHP using GD
<?php
/**
* validates an image upload
*
* @param string $inputName index name in the $_FILES super global
* @param array $acceptedTypes accepted file types, defaults to JPEG and PNG
* @return resource valid image when image is detected as valid
* @throws InvalidArgumentException if the image is not valid
**/
function validateImage(string $inputName, array $acceptedTypes = ["image/jpeg", "image/png"]) {