Skip to content

Instantly share code, notes, and snippets.

View tpmccallum's full-sized avatar

Timothy McCallum tpmccallum

View GitHub Profile
@tpmccallum
tpmccallum / vector_inheritance_testing.cpp
Last active June 4, 2018 03:21
Publicly inheriting from std::vector
/*
A base class, which can be inherited by a derived class, should have a virtual destructor. The std::vector class does not have a virtual destructor. Therefore, if a derived class is publicly inheriting the std::vector class, there is a high chance of a resource leak. Please consider the following example.
Reason for this example: To show that it is possible for the destructor of a Derived class not to execute.
This is because the Base class does not have a virtual destructor. This is a potential resource leak.
*/
#include <vector>
#include <iostream>
class Base {
@tpmccallum
tpmccallum / install_tendermint.txt
Last active September 3, 2018 07:25
Install Tendermint
#Housekeeping
cd ~
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y make
sudo apt-get install -y curl
#Golang
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
sudo -H tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz
@tpmccallum
tpmccallum / eosio_cleos_wallet_interaction.md
Last active August 3, 2018 00:06
EOSIO using cleos for wallet interaction

Suggestion about "cleos wallet open".

Perhaps we can add a bold note in the hackathon_how_to.md documentation which points out that a wallet has to be 1) opened and then 2) unlocked (always in that order).

Reason

Running the open command, after a wallet has been unlocked (re-opening or switching back to a wallet) locks the wallet.

Example

If you list the open wallets using the following command you can see 3 locked wallets

@tpmccallum
tpmccallum / install_eos_mainnet_macOS.txt
Last active September 1, 2018 10:05
EOS Installation on macOS (High Sierra) 10.13.6 - Also perform voting for EOS BP
# EOS source
cd ~
git clone https://github.com/EOSIO/eos.git
cd eos
git submodule update --init --recursive
# Deps
brew install MongoDB
brew install Doxygen
@tpmccallum
tpmccallum / first_try_at_scatter_and_html.md
Last active August 29, 2018 00:42
First try at Scatter and HTML

<!DOCTYPE html>
<html>
<head>
	<script>
		document.addEventListener("scatterLoaded", scatterExtension => { 
			const scatter = window.scatter; 
		})
		//Creating a collection of blockchain network options on page load
@tpmccallum
tpmccallum / cmt_testnet_scatter.asciidoc
Last active September 19, 2018 23:30
Installing a local CyberMiles Testnet instance and then writing a web application which uses Scatter
<!DOCTYPE html>
<html>

<head>
    <script type="text/javascript" src="modules/scatter-js-2.5.1/dist/scatter.min.js"></script>
    <script type="text/javascript" src="modules/web3.js/dist/web3.min.js"></script>
@tpmccallum
tpmccallum / web_app.html
Last active September 3, 2018 08:02
A quick web application to determine if CyberMiles blockchain can interoperate with Scatter by providing host, port, chainid etc.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="js/scatter.min.js"></script>
<script>
document.addEventListener('scatterLoaded', () => {
this.scatter = window.scatter;
window.scatter = null;
});
@tpmccallum
tpmccallum / cybermiles_development_environment.asciidoc
Last active September 23, 2018 01:14
A Gist which creates a CyberMiles development environment in your browser - Ubuntu

Prepare the standard Ubuntu installation

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install git
@tpmccallum
tpmccallum / travis_ubuntu_16.asciidoc
Last active September 29, 2018 02:27
Installing CyberMiles Travis Testnet on a test instance of Ubuntu 16.04 LTS

Disclaimer: These instructions are for a brand-new disposable 16.04 Ubuntu test instance which has the sole purpose of running and testing the CyberMiles Lity compiler, CyberMiles libENI framework and the CyberMiles testnet called Travis.

This file now lives at the following URL

Housekeeping

#/bin/bash
@tpmccallum
tpmccallum / generic_development_env.sh
Last active October 23, 2018 00:43
Create a CyberMiles DApp development environment
#!/bin/bash
# Ubuntu 16.04LTS CyberMiles DApp example
# This is a script which can quickly create an environment in which a CyberMiles decentralized application can be created from scratch.
# Housekeeping
cd ~
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential