Skip to content

Instantly share code, notes, and snippets.

View manxisuo's full-sized avatar
🎯
Focusing

Su Yun manxisuo

🎯
Focusing
View GitHub Profile
@manxisuo
manxisuo / sources.list
Created January 19, 2023 14:00 — forked from ishad0w/sources.list
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@manxisuo
manxisuo / ftp_uploader.py
Last active October 6, 2018 03:12 — forked from opnchaudhary/ftp_uploader.py
A sample example for uploading files using ftp in python
#!/usr/bin/python
import ftplib
def upload_1():
session = ftplib.FTP('example.com','username','password')
file = open('cup.mp4','rb') # file to send
session.storbinary('STOR '+'cup.mp4', file) # send the file
file.close() # close file and FTP
session.quit()
@manxisuo
manxisuo / sqlite3-jdbc.properties
Last active June 12, 2017 02:37
MyBatis使用SQLite3配置
# 数据库驱动
jdbc.driver=org.sqlite.JDBC
# 数据库文件位置(数据库文件为little.db,位于类路径下)
jdbc.url=jdbc:sqlite::resource:little.db
# 用户名(默认root)
jdbc.username=root
# 密码(默认root)
@manxisuo
manxisuo / js-crypto-libraries.md
Created October 3, 2015 00:14 — forked from yetone/js-crypto-libraries.md
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

I start with a list and plan to create a comparison table.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@manxisuo
manxisuo / 引用内容的样式.css
Created September 9, 2015 12:18
用于blockquote(即引用)的一个比较好的样式
/* 引用样式 */
blockquote {
background: #f9f9f9;
border-left: 10px solid #ccc;
margin: 1.5em 10px;
padding: .5em 10px;
quotes: "\201C""\201D""\2018""\2019";
}
blockquote:before {
arr = [3, 8, 4, 2, 6, 7, 9, 1, 5]
length = len(arr)
i = 1 #[1, length - 1] 表示第几趟遍历
j = 0 #[0, length - 1 - i] 表示某一趟遍历中,待比较的两个数中前一个数的位置
while i < length:
j = 0
while j < length - i:
if arr[j] > arr[j + 1]:
@manxisuo
manxisuo / [1]_thread.py
Last active August 29, 2015 14:22
Python Thread学习 (http://is.gd/kLyISF)
# encoding: UTF-8
import _thread as thread, time
import threading
# 一个用于在线程中执行的函数
def func():
for i in range(5):
print('func')
time.sleep(1)
@manxisuo
manxisuo / create_a_gist.py
Created June 5, 2015 14:54
create a gist in github
#coding:utf-8
import requests
import json
import os.path
def create_gist(file_path, name = None, desc = '', public = True):
TOKEN = '[your token]'
URL = 'https://api.github.com/gists'
headers = {'Authorization': 'token {0}'.format(TOKEN)}
# 使用iter函数
with open('a.txt', 'r') as file:
for l in iter(file.readline, ''):
print(l)
# file对象是iterable
with open('a.txt', 'r') as file:
for l in file:
print(l)
@manxisuo
manxisuo / fibonacci.py
Created June 4, 2015 13:50
斐波那契数列生成器
def fibonacci():
a = b = 1
yield a
yield b
while True:
a, b = b, a + b
yield b