Skip to content

Instantly share code, notes, and snippets.

View itdaniher's full-sized avatar

itdaniher itdaniher

  • mosslandia
View GitHub Profile
### Keybase proof
I hereby claim:
* I am itdaniher on github.
* I am itdaniher (https://keybase.io/itdaniher) on keybase.
* I have a public key whose fingerprint is BC42 5D3A 8091 B5D8 A819 5EE5 529B 51AA B9C6 FF82
To claim this, I am signing this object:
@itdaniher
itdaniher / agg.py
Last active August 6, 2017 21:36
log all the ports!
import aioudp
import asyncio
async def in_or_nothing(reader, duration = 1):
if reader == None:
return None
try:
return await asyncio.wait_for(reader.read(128), duration)
except asyncio.TimeoutError:
return None
@itdaniher
itdaniher / us_postal_codes.csv
Created September 8, 2017 07:39
us_postal_codes.csv
We can't make this file beautiful and searchable because it's too large.
Zip Code,Place Name,State,State,State Abbreviation,Latitude,Longitude
00501,Holtsville,New York,NY,Suffolk,40.8154,-73.0451
00544,Holtsville,New York,NY,Suffolk,40.8154,-73.0451
01001,Agawam,Massachusetts,MA,Hampden,42.0702,-72.6227
01002,Amherst,Massachusetts,MA,Hampshire,42.3671,-72.4646
01003,Amherst,Massachusetts,MA,Hampshire,42.3919,-72.5248
01004,Amherst,Massachusetts,MA,Hampshire,42.3845,-72.5132
01005,Barre,Massachusetts,MA,Worcester,42.4097,-72.1084
01007,Belchertown,Massachusetts,MA,Hampshire,42.2751,-72.411
01008,Blandford,Massachusetts,MA,Hampden,42.1829,-72.9361
@itdaniher
itdaniher / luhn_tester.py
Created October 4, 2017 16:36
luhn_tester.py
#! /usr/bin/python3
import random
def luhn_residue(digits):
return sum(sum(divmod(int(d)*(1 + i%2), 10))
for i, d in enumerate(digits[::-1])) % 10
def get_valid_luhn(N, preamble = ""):
part = preamble+''.join(str(random.randrange(0,9)) for _ in range(N-1-len(preamble)))
res = luhn_residue('{}{}'.format(part, 0))
@itdaniher
itdaniher / pololog
Created November 17, 2017 04:51
Poloniex Trollbox Log
This file has been truncated, but you can view the full file.
{'message': 'when are you going to lift the no trade on sia', 'username': 'Taniwha', 'time': 1496044046, 'reputation': 0}
{'message': 'guys just buy stratis', 'username': 'Konbro', 'time': 1496044046, 'reputation': 0}
{'message': 'DocNuance, hiiiii o/', 'username': 'Thehobbitwith9fingers', 'time': 1496044046, 'reputation': 315}
{'message': 'how come all cryptos are going down? its been like this for 3 days', 'username': 'nickleijenhorst', 'time': 1496044046, 'reputation': 0}
{'message': 'is there a reason bits is down?', 'username': 'nucleartrashout', 'time': 1496044049, 'reputation': 31}
{'message': 'Ban him. Mod spam', 'username': 'gamegrounds', 'time': 1496044053, 'reputation': 7}
{'message': 'Hotmetal, but not that slow. From what I gather, API users are able to push trades faster than we on the UI here', 'username': 'dlight_2016', 'time': 1496044059, 'reputation': 28}
{'message': 'd', 'username': 'Xinord', 'time': 1496044059, 'reputation': 31}
{'message': 'nickleijenhorst, what goes up comes down. easy
@itdaniher
itdaniher / py2-sweep-check.py
Created November 17, 2017 04:59
multithreaded python2.7 proxy checker
import sockschain
import urllib2
import time
import random
import re
import json
import requests
import pyping
import multiprocessing
import atexit
@itdaniher
itdaniher / min-char-rnn.py
Created November 20, 2017 20:16
min-char-rnn.py for python3
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
## add comments by weixsong
## reference page [The Unreasonable Effectiveness of Recurrent Neural Networks](http://karpathy.github.io/2015/05/21/rnn-effectiveness/)
## this is a 3 layers neuron network.
## input layer: one hot vector, dim: vocab * 1
@itdaniher
itdaniher / zwj
Created November 21, 2017 23:50
zero width test file - 1MB
This file has been truncated, but you can view the full file.
​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
@itdaniher
itdaniher / async_wrapper.py
Created November 30, 2017 21:17
async_wrapper.py
import concurrent.futures
async def async_wrapper(loop, functional, args=(None)):
with concurrent.futures.ThreadPoolExecutor() as executor:
return await loop.run_in_executor(executor, functional, args)
@itdaniher
itdaniher / netutils.py
Last active December 18, 2017 04:39
netutils.py
from time import time
import socket
import fcntl
import struct
import urllib.request, urllib.error, urllib.parse
import re
import json
ip_sources = ['https://wtfismyip.com/json', 'https://canhazip.com/', 'https://icanhazip.com', 'https://vyncke.org/ip.php', 'https://www.dan.me.uk/ipinfo', 'https://ipinfo.me/', 'https://my-ip.herokuapp.com/', 'https://httpbin.org/ip', 'https://onlinebanking.tdbank.com/']