Skip to content

Instantly share code, notes, and snippets.

@zhenyi2697
zhenyi2697 / urlparse.py
Created March 27, 2013 17:52
Python: urlparse demo
#!/usr/bin/python
# The urlparse module provides functions for breaking URLs down into their
# component parts, as defined by the relevant RFCs.
from urlparse import urlparse
# PARSING
parsed = urlparse('http://user:pass@NetLoc:80/path;parameters?query=argument#fragment')
@rswofxd
rswofxd / PySched.py
Created June 23, 2012 10:45
Python:任务调度,定时执行
#coding=utf-8
import time
import sched
import os
import threading
"""
sched模块,准确的说,它是一个调度(延时处理机制),每次想要定时执行某任务都必须写入一个调度。
使用步骤如下:
(1)生成调度器:
s = sched.scheduler(time.time,time.sleep)
@binderclip
binderclip / flask-mail-qq.py
Created August 4, 2015 07:48
用 Flask-Mail 通过 QQ 邮箱发送邮件
from flask import Flask
from flask_mail import Mail, Message
app = Flask(__name__)
app.config.update(
#EMAIL SETTINGS
MAIL_SERVER='smtp.qq.com',
MAIL_PORT=465,
MAIL_USE_SSL=True,
@jixunmoe
jixunmoe / README.md
Last active June 21, 2018 01:25
渣浪后黑脚本
@ruter
ruter / upload_file.py
Last active December 19, 2018 11:23
[上传文件 Controller] Odoo 上传文件 Controller #Odoo
@http.route('/api/v1/mro/upload_file', type='http', auth="user", method=['POST'], website=True, csrf=False)
def upload_requirement_file(self, ufile, res_id=0, res_model, **kwargs):
file = ufile
if file:
# 附件模型
Attachment = request.env['ir.attachment']
# 创建附件
attach = Attachment.create({
'name': file.filename,
'res_model': res_model,
@jvanasco
jvanasco / sqlassist.py
Created January 27, 2012 03:34
Supporting multiple database connections & Reflecting Tables in pyramid with sqlalchemy .7
r"""
sqlassist
~~~~~~~~~
v0.3
sections of code taken from :
- Mike Orr's package 'sqlahelper'
- Mike Bayer's blog post 'Django-style Database Routers in SQLAlchemy'
@582033
582033 / python
Created June 28, 2016 07:02
树莓派获取[cpu温度/cpu使用率/内存空闲率]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
显示树莓派cpu温度、使用率及内存使用率
'''
import os
def show_temp():
file = open("/sys/class/thermal/thermal_zone0/temp")
@nickytoh
nickytoh / iCloud API Demo in Node.js
Last active September 6, 2021 03:11
Request Contact List From iCloud
var uuid = require('node-uuid'),
https = require('https');
function iCloud(appleId, password) {
this.urls = {
"version" : "https://www.icloud.com/system/version.json",
"validate": "/setup/ws/1/validate?clientBuildNumber={0}&clientId={1}",
"login": "/setup/ws/1/login?clientBuildNumber={0}&clientId={1}"
}
@Ron3
Ron3 / History|-104b39d1|entries.json
Last active May 21, 2022 09:59
AWS Lambda初触
{"version":1,"resource":"file:///Users/ron/Documents/Work/Github/WastedLand_Unity/Assets/Code/BPGames/BPMono/BPMainController.cs","entries":[{"id":"asRE.cs","timestamp":1653017452369},{"id":"1N1A.cs","timestamp":1653017490920},{"id":"ZcIB.cs","timestamp":1653017517999},{"id":"1sWI.cs","timestamp":1653018848615},{"id":"b2y6.cs","timestamp":1653033123307},{"id":"p0fY.cs","timestamp":1653033276547},{"id":"SurA.cs","timestamp":1653033301622},{"id":"8aiu.cs","timestamp":1653033472606},{"id":"4qe9.cs","timestamp":1653038794506},{"id":"m05x.cs","timestamp":1653038809996},{"id":"8dkr.cs","timestamp":1653038832762},{"id":"xxRB.cs","timestamp":1653039127616},{"id":"1IX0.cs","timestamp":1653040123957}]}

Install x264

cd ~
git clone git://git.videolan.org/x264
cd x264
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
make -j4
sudo make install