Skip to content

Instantly share code, notes, and snippets.

Raine Revere raineorshine

Block or report user

Report or block raineorshine

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
raineorshine /
Last active Nov 16, 2019
5 Great Resources for Exception Handling Best Practices in Java

General Tip

"The trick is to catch exceptions at the proper layer, where your program can either meaningfully recover from the exception and continue without causing further errors, or provide the user with specific information, including instructions on how to recover from the error. When it is not practical for a method to do either of these, simply let the exception go so it can be caught later on and handled at the appropriate level."


Advantages of Exceptions
Excellent example of separating error-handling code from program logic

Three Rules for Effective Exception Handling
Longer explanation and case study of exception use, including the basic principles of "throw early" and "catch late". Clear and thorough.

raineorshine / sendRawTransaction.js
Last active Nov 15, 2019
Sends a raw transaction with web3 v1.2.2, ethereumjs-tx v2.1.1, and Infura
View sendRawTransaction.js
const Web3 = require('web3')
const Tx = require('ethereumjs-tx').Transaction
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider(''))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privateKey = new Buffer('PRIVATE_KEY', 'hex')
raineorshine / MyContract.sol
Last active Nov 7, 2019
Generate an AST for an Ethereum Solidity contract with the solidity-parser module.
View MyContract.sol
contract MyContract {
uint counter = 0;
function Count() {
function CallCount() {
raineorshine /
Last active Oct 20, 2019
Cheatsheet: git commands
# adding and committing
git add -A # stages All
git add . # stages new and modified, without deleted
git add -u # stages modified and deleted, without new
git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed.
git commit --amend --no-edit # Do so without having to edit the commit message.
# remotes - pushing, pulling, and tracking
git fetch # gets remote objects and refs. Needed if new branches were added on the remote.
git remote -v # Lists all remotes (verbose)
raineorshine / test.txt
Created Oct 4, 2019
Test gist linkability
View test.txt
This is a sample sentence.
That is a tample tentence.
raineorshine /
Created Mar 31, 2014
Bash Cheat Sheet: Just the Essentials (13 Commands). See for more.
man COMMAND # Look up help for the given command
pwd # Print working directory
cd MYDIR # Change directory to MYDIR
cd ~/ # Change directory to user root (/Users/USERNAME)
cd .. # Change directory up a level
mkdir NEWDIR # Create a new directory in the current folder called NEWDIR
raineorshine / memrise-export.js
Created Oct 22, 2016
Export Memrise course words to CSV
View memrise-export.js
Export Memrise course words to CSV.
1. Log into
2. Navigate to course home page (e.g.
3. Open Developer Console
4. Paste below script and hit enter
5. After all urls have been fetched, copy final word list into spreadsheet.
View new-package.json
"name": "",
"description": "",
"version": "0.0.0",
"author": {
"name": "Raine Revere",
"email": "",
"url": ""
"license": "ISC",
raineorshine /
Last active Aug 18, 2019
How to set up user authentication for a Chrome Extension using the Chrome Identity API

How to set up user authentication for a Chrome Extension using the Chrome Identity API

  1. Create a private key file, from which you can create the manifest key and Application ID, as detailed here:
  2. Add the manifest key to "key" in manifest.json
  3. Create a new project in Google Developer Console
  4. Go to "APIs & auth > Credentials" and create new client id for a Chrome Application using the Application ID generated in step 3.
  5. Copy the Client ID to oauth2.client_id in the manifest.json


You can’t perform that action at this time.