Skip to content

Instantly share code, notes, and snippets.

reduced_frame = {"Arranging": {"info": {"chi_name": "排列", "description": "施動者將複雜轉移體置於某特定格局中,該格局可以是以某種排列順序,也可以是一種序列,還可以是空間位置。", "eng_name": "Arranging", "fes": {}}, "lus": ["安放/v;", "安排/v;", "擺佈/v;", "擺放/v;", "擺列/v;", "佈景/v;", "佈局/v;", "布設/v;", "布展/v;", "佈陣/v;", "佈置/v;", "陳放/v;", "陳列/v;", "陳設/v;", "歸檔/v;", "歸類/v;", "歸整/v;", "歸置/v;", "規整/v;", "排/v;", "排版/v;", "排列/v;", "排序/v;", "排字/v;", "梳理/v;", "整理/v;"], "noncore_fes": [{"chi_name": "環境條件", "description": "環境條件指施動者排列轉移體的情形。", "eng_name": "Circumstances", "abbr": "circ"}, {"chi_name": "程度", "description": "排列行為的程度。", "eng_name": "Degree", "abbr": "degr"}, {"chi_name": "工具", "description": "施動者用來改變轉移體格局的實體。", "eng_name": "Instrument", "abbr": "instru"}, {"chi_name": "地點", "description": "轉移體被置於一格局中的地點。", "eng_name": "Location", "abbr": "loc"}, {"chi_name": "方式", "description": "任何未被更為具體的框架元素所包括的對排列行為所進行的描述,包括認知限定(如:可能、大概、神秘地),力量(如:堅硬地、柔軟地)次要影響(如:安靜地、大聲地)),以及對事件進行比較所作出的一概括性描述(如:相同地)。該描述也可以是影響施動者行為的某些明顯特徵(如:渴望地、小心地)", "eng_name": "Manner", "abbr": "manr"}, {"chi_na
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def make_sticker(url):
response = requests.get(url)
im = Image.open(BytesIO(response.content))
foreground = ImageOps.fit(im, mask.size, centering=(0.5, 0.5))
foreground.putalpha(mask)
background = Image.open("media/background.png")
background.paste(foreground, (1905, 970), foreground)
background.save("media/output.png")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import hashlib
import time
import xmltodict
from flask import Flask, request
app = Flask(__name__)
WECHAT_TOKEN = "wechat_token"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@henryyang42
henryyang42 / letsencrypt.md
Created July 1, 2017 07:50 — forked from xrstf/letsencrypt.md
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@henryyang42
henryyang42 / README.md
Last active June 12, 2017 04:58
Miner config

Put auto_restart.bat, auto_restart.bat, reboot.bat in miner's folder. Put start_f2pool_mining.bat - 捷徑, auto_restart.bat - 捷徑 to C:\Users\thyang-miner2\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup to execute them on boot.

import datetime
import requests
import time
import logging
import os
import sys
from bs4 import BeautifulSoup
content_template = '過去24小時收益: {:.6} ETH ({:.6} {})'
title_template = '魚池礦機狀態 {}'
subtitle_template = '15分鐘/1小時均速: {}/{} Mhash/s'