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 | |
# | |
# 台灣 OSM 圖資自動更新程式,會自動檢查更新,有更新時下載,並且匯入到 PostGIS | |
# | |
# 系統需求: | |
# * wget | |
# * osm2pgsql 並且內含 PBF 圖資格式支援 | |
# | |
# 測試環境: | |
# * Ubuntu 14.04.1 LTS |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 random | |
import asyncio | |
class PDCACycle: | |
def __init__(self): | |
self.bad_mood = 0 | |
self.interval = 1 | |
async def plan(self, name): |
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
''' | |
log show --style syslog \ | |
--start "2018-12-26 18:00:00" \ | |
--predicate 'process == "loginwindow"' \ | |
| grep 'unlock' | |
''' | |
import os | |
import time | |
import datetime |
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 subprocess | |
import cairo | |
import wx | |
import wx.lib.wxcairo | |
WIDTH = 400 | |
HEIGHT = 300 | |
surface = cairo.ImageSurface( |
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 python3 | |
# Unicode 重複漢字測試 | |
# | |
# 參考: http://maraboy.com/node/83 | |
# | |
# 執行結果: | |
# 你的 [懶叫] 跟我的 [懶叫] 不一樣 | |
# * 你的 [懶叫] 編碼是: [F90D,53EB] | |
# * 我的 [懶叫] 編碼是: [61F6,53EB] | |
# 用 [NFC] 喬一下你的 [懶叫] 和我的 [懶叫] |
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 io | |
import json | |
import os | |
import re | |
import requests | |
import sys | |
import tkinter as tk | |
from PIL import ImageTk, Image | |
from bs4 import BeautifulSoup |
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
""" | |
Classify photos by EXIF attributes. | |
Before classified: | |
DCIM | |
├── 100ANDRO | |
│ ├── DSC_2828.JPG | |
│ └── DSC_2830.JPG | |
├── 99ANDRO |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 os | |
import random | |
import subprocess | |
def ps_exec(cmd, adminPriv=False): | |
""" 使用 Windows PowerShell Start-Process 執行程式, 回傳 STDOUT, 並且支援以系統管理員身分執行 """ | |
# 產生隨機檔名, 用來儲存 stdout | |
existed = True | |
while existed: |
OlderNewer