Skip to content

Instantly share code, notes, and snippets.

@jhodges10
jhodges10 / darkcoinClient.ts
Last active September 5, 2018 23:40
Figuring out type errors with gobjectprepare
import * as Req from 'request-promise-lite';
import * as DashD from './RPCDefinitions';
/**
* Each call returns this
*/
export interface CallResult<A> {
readonly result?: A;
readonly error?: any;
readonly id: number;
import psycopg2
import time
import selenium
from selenium import webdriver
import openpyxl
from openpyxl import load_workbook
import subprocess
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
@jhodges10
jhodges10 / trigger_tally.py
Last active September 2, 2018 20:03
Generates the final vote tally at the time voting closed
import requests
import pandas as pd
import json
import datetime
import time
import timeit
from bin.DashInfo import DataPreparation
# For calculating vote snapshots
@jhodges10
jhodges10 / Readme.md
Last active August 31, 2018 07:29
Checks the Tether Omni explorer with the help of a cron entry ever X minutes and then notifies via e-mail and via Slack webhooks.

Tether Notifier

Requirements

  • cron entry to run this script every x minues
  • A Redis instance
  • A Sendgrid API key
  • A Slack webhook

Environment Variabls

import requests
import seaborn as sns
import pandas as pd
import os
import time
from lib.mn_count import get_cur_mn_count
nexus_hash = "7877338b947d7fe25d4dcc80979ee1f918736596677188ebadc79e5b9009d847"
@jhodges10
jhodges10 / vote_switcher.py
Created August 8, 2018 00:02
Checks for swapped votes using the Dash Intel vote Database
from bin.db_functions import IntelDatabase
from bin.DashInfo import DataPreparation
test_prop_hash = '7877338b947d7fe25d4dcc80979ee1f918736596677188ebadc79e5b9009d847'
def check_for_changed_votes():
node_dict = {}
votes_dict = IntelDatabase.get_votes_for_hash(test_prop_hash)
DataPreparation.write_json(votes_dict, 'votes_data')
import os
import sys
import time
import json
from pprint import pprint
from json import JSONDecodeError
data_dir = os.path.abspath("G:\hyperscratch\Dash Network Stats")
@jhodges10
jhodges10 / zmq_test.py
Last active July 3, 2018 19:11
Dash ZeroMQ Test
#!/usr/bin/env python
import binascii
import zmq
import struct
import csv
import time
port = 28332
@jhodges10
jhodges10 / insight_class.py
Last active August 31, 2018 07:38
Insight API as a class
import requests
import json
from json import JSONDecodeError
import random
from multiprocessing import Pool
from functools import partial
class Insight(object):
self.round_robin_url = ""
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import time, os, sys
print("Starting Spam Program")
password = "d9060549bd53cda3fc0f891b5f4a586271d5ee6a180ade1ea2bfe3985ccc7b01"
user = "6594052d2802c63e763caad3afdd5a2babcdacc4daf47277ca91d4d050d25d16"
def rpc_conn(user=user, password=password):
rpc_conn = AuthServiceProxy("http://%s:%s@localhost:9998" % (user, password))