Skip to content

Instantly share code, notes, and snippets.

View onitonitonito's full-sized avatar
🎯
Focusing

Kay SuParX the Cat Person onitonitonito

🎯
Focusing
View GitHub Profile
@onitonitonito
onitonitonito / nonce_pow.py
Last active July 25, 2020 11:10
What is the POW (Proof of Work) in Bit-coin miining? - test POW with Python
"""
* nonce 만이 유일하게 변경할 수 있는 값이다. 값을 1씩 증가 시키며 찾는다.
* 우연히 해쉬값의 첫자리가 '0000'으로 시작하는 해쉬를 발견 했을 때,
* 작업 증명을 완성 한다. 작업증명(Proof of Work) 값은 nonce=7725 이다.
"""
import time
import pyprnt
from hashlib import sha256
@onitonitonito
onitonitonito / result1_difficulty_4.txt
Created July 25, 2020 11:08
What is the POW (Proof of Work) in Bit-coin miining? - test POW with Python
"""
* nonce 만이 유일하게 변경할 수 있는 값이다. 값을 1씩 증가 시키며 찾는다.
* 우연히 해쉬값의 첫자리가 '0000'으로 시작하는 해쉬를 발견 했을 때,
* 작업 증명을 완성 한다. 작업증명(Proof of Work) 값은 nonce=7725 이다.
"""
import time
import pyprnt
from hashlib import sha256
@onitonitonito
onitonitonito / _add_syspath_root.py
Last active July 25, 2020 02:07
Multiple Move of Turtle Using QtPy UI - Use pre inputed coordination data
# ------ root path 를 sys.path.insert 시키는 코드 ... 최소 4줄 필요------
import os, sys # 1
top = "k_mooc_reboot" # 2 = name of Top folder
root = "".join(os.path.dirname(__file__).partition(top)[:2])+"\\" # 3 = root_dir for top folder
sys.path.insert(0, root) # 4
# ---------------------------------------------------------------------
@onitonitonito
onitonitonito / result_CMD.txt
Last active July 24, 2020 14:36
To Show Coordination X,Y Numbering on the BOARD (Field)
# show [27x15] text grid board
0 . 1 . 2
123456789012345678901234567
1 ........................... 1
2 ........................... 2
3 ........................... 3
4 ........................... 4
5 ........................... 5
@onitonitonito
onitonitonito / gist:17400f9eed020e033279d8c2fa90a13c
Last active July 24, 2020 11:51
drawing Xmas tree around this time of year
"""
# 이맘 때, 한번 쯤 만들어 보는 Xmas 트리 - 생활코딩
# http://bit.ly/2EXwk1r
"""
# https://www.facebook.com/photo.php?fbid=3199985326694503
# &set=gm.3602534863120357&type=3&theater&ifg=1
import os
import time
# coding: utf-8
# ## 청라, 송도지역 미세먼지 측정값 스크래핑
# > 1. 송도 = http://air.incheon.go.kr/airinch/real3.html?area_other_index=999992
# > 1. 청라 = http://air.incheon.go.kr/airinch/real3.html?area_other_index=999991
#
# * Todo: 계측 센서 갯수가 다르므로 필터링 방식이 달라져야 한다
# * 송도 = 6개 / 청라 = 4개
# In[1]:
@onitonitonito
onitonitonito / lott.css
Last active August 11, 2018 02:33
pick_6numbers_out_of_45
#NUMBERS {
margin-top: 5vh;
font-size: 3em;
color: #fff;
text-align: center;
}
b {
@onitonitonito
onitonitonito / test.ipynb
Created November 7, 2017 11:42
test jupyter notebook viewer --- nbviewer.jupyter.org
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@onitonitonito
onitonitonito / 01_guess_why.py
Last active June 29, 2017 01:02
Guess why? - looks a bit weird result.. describe WHY?
# Two Different Results
# Compare #A-1 to #B-1
# Guess why? thinking about join() function.
# board = [[ str(n) for n in range(7,12) ]] #A
board = [ str(n) for n in range(7,12) ] #B
print (board)
for t in board:
@onitonitonito
onitonitonito / css_cache_buster_original.py
Last active July 24, 2017 16:51
Solving CSS Cache Problems in FLASK web framework on Windows Platform
'''
flask.org suggests to use snipets of cache buster as below
http://flask.pocoo.org/snippets/40/
'''
@app.context_processor
def override_url_for():
return dict(url_for=dated_url_for)
def dated_url_for(endpoint, **values):