Skip to content

Instantly share code, notes, and snippets.

@xiispace
xiispace / conf.py
Created December 6, 2017 01:49
sphinx 生成 latexpdf 去掉题注
# 修改latex_elements
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
@xiispace
xiispace / lottery.js
Created January 29, 2018 01:27
js大轮盘抽奖代码
(function(){
/**
* Date: 2017/8/18
* Email: 506713930@qq.com
* Author: hishion
*
* [Lottery 大转盘抽奖js插件, 无依赖, 简单易用]
* @param {[Dom Object]} oCanvas [canvas对象]
* @param {[Object]} options [配置参数, 请参考底部的_setOptions方法中的config对象]
*/
@xiispace
xiispace / common.js
Last active January 31, 2018 03:40
js 常用功能函数
//**************已使用*********************
$(document).ready(function() {
//页面权限控制
$.ajaxSetup({
contentType:"application/x-www-form-urlencoded;charset=utf-8",
//跨域处理
// xhrFields: {
// withCredentials: true
// },
// crossDomain: true,
@xiispace
xiispace / crypt.py
Created May 25, 2018 07:14
python kernel crypt
from socket import socket, AF_ALG, SOCK_SEQPACKET, SOL_ALG, ALG_SET_KEY
from binascii import hexlify
with socket(AF_ALG, SOCK_SEQPACKET, 0) as alg:
alg.bind(('hash', 'hmac(sha512)'))
alg.setsockopt(SOL_ALG, ALG_SET_KEY, b'key')
op, _ = alg.accept()
with open('/etc/passwd', 'rb') as f:
op.sendfile(f)
print(hexlify(op.recv(64)))
op.close()
@xiispace
xiispace / .tmux.conf
Created March 22, 2019 07:23
tmux 配置文件
set -g prefix2 C-a
bind C-a send-prefix -2
set -g base-index 1
setw -g pane-base-index 1
set nu
let mapleader = ","
call plug#begin('~/.local/share/nvim/plugged')
Plug 'liuchengxu/vim-better-default'
call plug#end()
@xiispace
xiispace / smooth.py
Created May 30, 2019 03:33
python smooth client request
period = 300 # seconds
current = datetime_now()
next_ts = (current.timestamp() // period + random.random() + 1) * period