This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding:utf8 -*- | |
import json | |
import os | |
import re | |
import shutil | |
import time | |
import urllib.parse | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat stock.py | |
#! /usr/bin/python3 | |
import sys | |
import twstock | |
if __name__ == '__main__': | |
if len(sys.argv) == 2: | |
s = twstock.Stock(sys.argv[1]) | |
print(s.price[-5:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = 'https://dmz9.moea.gov.tw/gmweb/investigate/InvestigateFactory.aspx' | |
data = {'ContentPlaceHolder1_tvFactoryKind_ExpandState': 'enccccccccccccccccccccccccccc', 'ContentPlaceHolder1_tvFactoryKind_SelectedNode': None, 'ContentPlaceHolder1_tvFactoryKind_PopulateLog': None, 'ContentPlaceHolder1_tvFactoryCity_ExpandState': 'nccccccccccccccccccccccnnnn', 'ContentPlaceHolder1_tvFactoryCity_SelectedNode': '', 'ContentPlaceHolder1_tvFactoryCity_PopulateLog': '21', '__VIEWSTATE': 'YYjM0pqILvA3Eu7HPXHYreoy0OqGFwQM//1GCFFOS29N+hKXpYscfNDhG7AiPOCTBz/E9cvB9a9P/B4neja9RnXq2pQFXo34dvHgd4Gyh9EqWlziz9vDwQnhxKH+3ubpkWB0pBLukg78iuDsbWjj5jRC/hEZ8pOWlwEjjmuIwcvzXYF3z8ChQCvsz4Rcu5AalzuJz6S8fy1jWHiIWd0b0y/zel0/7viVeRYyVhvoYeprw+11k1qqq/nZNWufzs1ZO3ngPOzM3j0iC+HhwN0+73fhcLELrj0t2RIs3xTQ4hY7LSziWHCqd9deQNIOAXjxaMITi/bwtH5knagvUqk2G3KUGTBK8QCwxjoyixutx6oG820isP0/KT5c2ngxnehmqtCQG2070luTGjcKKmk2NdhZelsCpI8oHP78zkkc8tAynzIxwb1e0XlA5i6xCIXm4C9VwIyuj4Bw6fKZglpNeuUjdxE7hHfTH84qpWvkrDFvQEYZyekUSvGzlVokws5Ho6+VuZbec5qk5lt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <kernel/syscalls.h> | |
#include "sh.h" | |
int _sleep(int ms) { | |
return do_syscall1((void *) ms, SYS_MSLEEP); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import re | |
import requests | |
from collections import defaultdict | |
from lxml import etree | |
URL = 'https://jobhelper.g0v.ronny.tw/package/show/%d' | |
REGEX = '第\\d+條第\\d+項第\\d+款|第\\d+條第\\d+項|第\\d+條' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import iotapy | |
r = iotapy.storage.providers.rocksdb.RocksDBProvider('/var/db/iota/mainnetdb', '/var/db/iota/mainnetdb.log', read_only=True) | |
r.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from db import r as tangle | |
def get_latest_30_milestone_hash(): | |
index, milestone = tangle.latest('milestone') | |
for i in range(index, index - 30, -1): | |
m = tangle.get(i, 'milestone') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated file; DO NOT EDIT. | |
# OpenWrt Configuration | |
# | |
CONFIG_MODULES=y | |
CONFIG_HAVE_DOT_CONFIG=y | |
# CONFIG_TARGET_sunxi is not set | |
# CONFIG_TARGET_apm821xx is not set | |
# CONFIG_TARGET_ath25 is not set | |
# CONFIG_TARGET_ar71xx is not set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated file; DO NOT EDIT. | |
# OpenWrt Configuration | |
# | |
CONFIG_MODULES=y | |
CONFIG_HAVE_DOT_CONFIG=y | |
# CONFIG_TARGET_sunxi is not set | |
# CONFIG_TARGET_apm821xx is not set | |
# CONFIG_TARGET_ath25 is not set | |
# CONFIG_TARGET_ar71xx is not set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated file; DO NOT EDIT. | |
# OpenWrt Configuration | |
# | |
CONFIG_MODULES=y | |
CONFIG_HAVE_DOT_CONFIG=y | |
# CONFIG_TARGET_sunxi is not set | |
# CONFIG_TARGET_apm821xx is not set | |
# CONFIG_TARGET_ath25 is not set | |
# CONFIG_TARGET_ar71xx is not set |
OlderNewer