This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers'); | |
async function main() { | |
let privatekey = '<<PRIVATE_KEY>>'; // Yeah this should be done through an env var, I know but this is a f gist | |
let wallet = new ethers.Wallet(privatekey); | |
console.log('Using wallet address ' + wallet.address); | |
let transaction = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Augur = require('augur.js'); | |
const augur = new Augur(); | |
const augurConnection = 'ws://predictions.market:9001'; | |
const connect = () => new Promise((resolve, reject) => { | |
augur.augurNode.connect( | |
augurConnection, | |
(error, wsTransport) => { | |
if (error) reject(error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.25; | |
contract StandardToken { | |
mapping (address => uint256) balances; | |
mapping (address => mapping (address => uint256)) allowed; | |
uint256 public totalSupply; | |
// Optional | |
string public name; | |
uint8 public decimals; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/gun/lib/webrtc.js"></script> | |
<script> | |
// Emiter | |
var gun = Gun(['http://localhost:8765/gun', '<<YOUR GUN SERVER>>']); | |
// This function adds a new user to a list | |
function addUser(userName) { | |
var users = gun.get('users'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SingleObject { | |
//create an object of SingleObject | |
private static SingleObject instance = new SingleObject(); | |
//make the constructor private so that this class cannot be | |
//instantiated | |
private SingleObject(){} | |
//Get the only object available |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Circle implements Shape { | |
@Override | |
public void draw() { | |
System.out.println("Inside Circle::draw() method."); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Circle implements Shape { | |
@Override | |
public void draw() { | |
System.out.println("Shape: Circle"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BinaryObserver extends Observer{ | |
public BinaryObserver(Subject subject){ | |
this.subject = subject; | |
this.subject.attach(this); | |
} | |
@Override | |
public void update() { | |
System.out.println( "Binary String: " + Integer.toBinaryString( subject.getState() ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
namespace AlienScrap | |
{ | |
class Program |