Skip to content

Instantly share code, notes, and snippets.

Avatar
🦍
Focusing

dongyi dongyi

🦍
Focusing
  • Mampod
  • 上海
View GitHub Profile
View ebury.py
# new build worked ebury client
import json
import requests
from base64 import b64encode
from urllib.parse import urlencode
from uuid import uuid4
from service.fx import FXService
from django.utils import timezone
# docs : https://docs.ebury.io/?python#introduction
View vin_decoder.py
import os
VIN_CHARS = "ABCDEFGHIJKLMNOPRSTUVWXYZ1234567890"
VIN_REGIONS = [("A", "H", "Africa"),
("J", "R", "Asia"),
("S", "Z", "Europe"),
("1", "5", "North America"),
("6", "7", "Oceania"),
("8", "9", "South America")]
View logstash rule
input {
tcp {
port => 5000
}
}
## Add your filters / logstash plugins configuration here
filter {
kv {
source => "message"
View btc
比特币挖矿研究
---------------
### 挖矿算法比较
#### 比特币(bitcoin), 莱特币(litecoin)
* 节点运行记账程序, 并把工作量证明加上一个随机数, 两次SHA256运算后, 得到一个hash值, 如果小于当前的目标值, 就在比特币网络上获得了记账权, 获得12.5个比特币(每四年减半)
* 比特币网络每2016个区块根据当前的网络总算力调整难度, 保证每10分钟出一个区块
* 目前多数比特币, 莱特币的挖矿是用ASIC(大规模集成电路)运行
View from other guy
<!DOCTYPE html>
<html>
<head>
<!-- Charset and load required libraries -->
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://dimplejs.org/dist/dimple.v2.0.0.min.js"></script>
<style>
/* Title */
View udacity_enron_fraud
#!/usr/bin/python
import sys
import pickle
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
from tester import dump_classifier_and_data
View html convert
from bs4 import BeautifulSoup
import sys
def convert_html(filename):
f = open(filename)
soup = BeautifulSoup(f)
f.close()
with open(filename.replace('.html', '.xml'), 'w') as ff:
ff.write(soup.prettify())
View page
<html>
<script type="text/javascript" src="https://files.coinmarketcap.com/static/widget/currency.js"></script>
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
<script>
$(document).ready(function(){
setTimeout(function() {
window.location.reload(1)
View gist:5bb7f9839ee1c3f81b92
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
@dongyi
dongyi / __init__.py
Created Jan 5, 2012 — forked from ipconfiger/__init__.py
OAuth包,实现了sina,QQ,网易,搜狐的OAuth认证
View __init__.py
# -*- Encoding: utf-8 -*-
import base64
import binascii
import cgi
import hashlib
import hmac
import logging
import time
import urllib
import urlparse