I hereby claim:
- I am zhanglongqi on github.
- I am longqi (https://keybase.io/longqi) on keybase.
- I have a public key whose fingerprint is EAD9 C1AE C3CE 48E3 5F1B D0AC 17C6 A1D4 DEA0 8339
To claim this, I am signing this object:
| =trim(REGEXEXTRACT(REGEXREPLACE(REGEXREPLACE(A730,"https?://",""),"^(w{3}\.)?","")&"/","([^/?]+)")) |
| import socket | |
| def check_internet(host="8.8.8.8", port=53, timeout=3): | |
| """ | |
| Host: 8.8.8.8 (google-public-dns-a.google.com) | |
| OpenPort: 53/tcp | |
| Service: domain (DNS/TCP) | |
| """ | |
| try: | |
| socket.setdefaulttimeout(timeout) | |
| s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| import pickle | |
| data1 = {'foo': [1, 2, 3], | |
| 'bar': ('Hello', 'world!'), | |
| 'baz': True} | |
| # write the pickled data to the file jar | |
| with open('data.pkl', mode='wb') as jar: | |
| pickle.dump(data1, jar, fix_imports=True) |
| echo $(( `ls -l brief | grep -e ".*json.old$" | wc -l` / `ls -l brief | wc -l`.0 )) | |
| # 0.71987643734567586 |
| // ==UserScript== | |
| // @name NTU WebMail | |
| // @namespace https://github.com/zhanglongqi | |
| // @version 0.2 | |
| // @description keep NTU webmail cookies | |
| // @author Zhang LongQi | |
| // @match https://webmail.ntu.edu.sg/owa/auth/logon.aspx* | |
| // @grant none | |
| // @updateURL https://gist.github.com/zhanglongqi/ae244a0cd16ac8b76abbf6ce755be40b |
| // ==UserScript== | |
| // @name wechat | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.2 | |
| // @description expand the width of wechat article to 100%, hide the QR code div | |
| // @author LongQi | |
| // @match https://mp.weixin.qq.com/* | |
| // @grant none | |
| // @updateURL https://gist.github.com/zhanglongqi/24d3410126cb706b2307173c6e0a8b64 |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| longqi 30/Jun/17 16:36 | |
| Description: | |
| """ | |
| from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_BROADCAST, SO_REUSEADDR |
| from os import chdir | |
| from os.path import join, dirname | |
| from http.server import SimpleHTTPRequestHandler, test | |
| chdir(join(dirname(__file__), 'YOUR_WEB_ROOT_PATH')) | |
| test(SimpleHTTPRequestHandler, port=8080, bind='0.0.0.0') |
| <h1 style="position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| transform: translateX(-50%) translateY(-50%)"> Loading...</h1> |
I hereby claim:
To claim this, I am signing this object: