Skip to content

Instantly share code, notes, and snippets.

View Foair's full-sized avatar
🦩
Proceeding...

Foair

🦩
Proceeding...
View GitHub Profile
@Foair
Foair / del_desktop_ini.bat
Last active July 2, 2017 13:48
删除 desktop.ini
DEL desktop.ini /A
@Foair
Foair / locker_possibility.cpp
Last active July 2, 2017 13:03
Android 手机九宫锁的可能性
#include <iostream>
using namespace std;
long c = 0, p = 0;
int a[9];
void s(int k)
{
if (a[k] == 0)
{
@Foair
Foair / tcp_client.py
Created July 2, 2017 13:32
Python TCP 客户端、服务端程序
"""客户端程序"""
import socket
# 创建客户端的套接字(socket.AF_INET 指定使用 IPv4 协议,socket.SOCK_STREAM 指定使用流式 TCP 连接)
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# 建立连接
client.connect(('127.0.0.1', 9999))
# 接收欢迎信息
print(client.recv(1024).decode('utf-8'))
# 发送数据
@Foair
Foair / email_receiver.py
Last active July 2, 2017 13:41
Python email 发送程序、接收程序
import poplib
from email.parser import Parser
from email.header import decode_header
from email.utils import parseaddr
email = 'i@foair.com'
password = ''
pop3_server = 'pop.exmail.qq.com'
server = poplib.POP3(pop3_server)
@Foair
Foair / udp_client.py
Created July 2, 2017 13:43
Python UDP 客户端、服务端程序
"""TCP 客户端"""
import socket
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for data in [b'Tracy', b'Victor']:
client.sendto(data, ('127.0.0.1', 9999))
print(client.recv(1024).decode('utf-8'))
client.close()
@Foair
Foair / aria2.conf
Last active January 16, 2018 11:00
# aria2 配置 #
# aria2:https://aria2.github.io/
# 官方文档:https://aria2.github.io/manual/en/html/index.html
# aria2c 文档:https://aria2.github.io/manual/en/html/aria2c.html
# 选项和默认值可查询文档
# 书写方式 #
# ? 删掉第 1 行前面的「#」 ? 删掉第 2 行前面的「#」 ? ...
# ##<bt-enable-lpd> 找到 bt-enable-lpd 并将其注释
# #bt-tracker=<URI>,... 替换 <URI> 为其他内容
@Foair
Foair / aria2c.py
Created January 31, 2018 11:07 — forked from lpimem/aria2c.py
Aria2 Python Client
import json
import requests
class Aria2c:
'''
Example :
client = Aria2c('localhost', '6800')
# print server version
@Foair
Foair / a_hrefs.js
Created February 14, 2018 10:52
从网页导出播放列表的链接
str = ''
for (a of $0.getElementsByTagName('a')) {
str += 'you-get ' + a.href + '\n'
}
console.log(str)
@Foair
Foair / show_me_how_to_write.html
Last active February 25, 2019 02:40
一个用于展示大屏汉字的网页
<!DOCTYPE html>
<html lang="cmn-Hans">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=Edge">
<title>学汉字</title>
<style>
body {
@Foair
Foair / HOSTS.conf
Last active September 11, 2025 09:57
# LOCAL DEV
127.0.0.1 notes
127.0.0.1 io
127.0.0.1 app
# BLOCK OR ALLOW SOFTWARE
## XMind
0.0.0.0 www.xmind.net
## Bandicam