Skip to content

Instantly share code, notes, and snippets.

@aaroncox
aaroncox / authorityprovider.js
Last active March 15, 2024 14:57
Using a custom authority provider within eosjs for Greymass Fuel
// A custom cosigner AuthorityProvider for EOSJS v2
// This provider overrides the checks on all keys,
// allowing a partially signed transaction to be
// broadcast to the API node.
class CosignAuthorityProvider {
async getRequiredKeys(args) {
const { transaction } = args;
// Iterate over the actions and authorizations
transaction.actions.forEach((action, ti) => {
action.authorization.forEach((auth, ai) => {
@aaroncox
aaroncox / cosign_noop.js
Created December 11, 2019 01:19
The first action to include in a transaction to use Greymass Fuel
const cosign_noop = {
account: 'greymassnoop',
name: 'noop',
authorization: [
{
actor: 'greymassfuel',
permission: 'cosign',
}
],
data: {}
# Install HomeBrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# Install Git
brew install git
# Install wget
brew install wget
# Install NodeJS
@aaroncox
aaroncox / gist:5548105
Created May 9, 2013 15:16
Cloning a Repo from Github using Dulwich/Python
#!/usr/bin/env python
import dulwich.client
from dulwich.repo import Repo
from dulwich import index
import os
import shutil
client, path = dulwich.client.get_transport_and_path("https://github.com/aaroncox/d3.git")
@aaroncox
aaroncox / Dockerfile
Created July 4, 2019 06:09
Ubuntu 16.04 eos-voter build
FROM ubuntu:16.04
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get update \
&& apt-get install -y build-essential g++ gcc git curl python make libusb-dev libudev-dev libusb-1.0-0-dev \
&& apt-get -y autoclean
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 8.16.0
@aaroncox
aaroncox / nginx.conf
Last active August 25, 2018 19:00
nodeosd / nginx configuration
user www-data;
worker_processes auto;
worker_rlimit_nofile 65535;
pid /run/nginx.pid;
# include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 10000;
@aaroncox
aaroncox / unsigned.json
Created August 13, 2018 05:00
unsigned transaction format
{
"contract": {
"account": "ridlridlcoin",
"abi": {
"version": "eosio::abi/1.0",
"types": [
{
"new_type_name": "account_name",
"type": "name"
}

Keybase proof

I hereby claim:

  • I am aaroncox on github.
  • I am jesta (https://keybase.io/jesta) on keybase.
  • I have a public key ASDn2T8U_KLuUmUq_NIq8yLEUpS3hovLg903aqpzhnOqWgo

To claim this, I am signing this object:

@aaroncox
aaroncox / index.html
Last active December 18, 2015 08:18
Synchronous Build Requests
<html>
<head></head>
<body>
<!-- ... (The rest of the page page) ... -->
<script type="text/javascript" charset="utf-8">
$(function() {
d3up.getBuild(1);
d3up.getBuild(2);
console.log(d3up.builds);
});
@aaroncox
aaroncox / d3up-v2-output.json
Last active December 18, 2015 04:29
D3Up Calc V2 Stats Output
{
"stats": {
"armor": 5320,
"life": 31076,
"attack-speed": 9,
"critical-hit": 49.5,
"critical-hit-damage": 190,
"strength": 1959,
"intelligence": 307,
"dexterity": 127,