this is a very simple messge service with static file written in py
非常简单的基于静态文件的使用py写的消息服务
#!/bin/env python | |
#bili xml <==> Dplayer json converter | |
import sys,json | |
# struct and vars | |
xmlhead0="<i><chatserver>" | |
xmlhead1="</chatserver><chatid>" | |
xmlhead2="</chatid><mission>0</mission><maxlimit>" | |
xmlhead3="</maxlimit><source></source><ds></ds><de></de><max_count>" |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>HLS Player</title> | |
<link href="/css/DPlayer.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div id="player1" class="dplayer"></div> | |
<script src="/js/DPlayer.min.js"></script><!-- Dplayer 2.0, using master branch --> |
/** | |
* hexo-tag-dplayer | |
* Syntax: | |
* {% dplayer key=value ... %} | |
*/ | |
'use strict'; | |
const fs = require('hexo-fs'), | |
util = require('hexo-util'), | |
urlFn = require('url'), | |
path = require('path'), |
#!/usr/bin/env python | |
# WTFPL | |
import base64 as b64 | |
import sys,zipfile,os.path | |
from Crypto.Cipher import AES | |
if __name__ == "__main__": | |
basename = os.path.basename(sys.argv[1]) |
import cv2 | |
vc = cv2.VideoCapture('ba.mp4') | |
c=1 | |
fs = 1 | |
count = 0 | |
fuckl = lambda x : b"#" if x > 20 else b" " |
#!/usr/bin/env python3 | |
# -*- coding:utf-8 -*- | |
# test python file for zmifi MF855 | |
# using default password zimifi | |
# WTFPL | |
import re, hashlib, random, json, datetime | |
import requests | |
from collections import defaultdict |
使用类似
void replaceOnReceive(int (*cb) (/*arguments of php_swoole_OnReceive...*/)){
void * pSwooleG = dlsym(/*arguments to get SwooleG...*/);
void * pServ = pSwooleG+OFFSET_SERV;
void * pOnReceive2Replace = (*pServ)+OFFSET_ONRECV;
assert(*pOnReceive2Replace == php_swoole_OnReceive);
*pOnReceive2Replace = cb;
}
#!/home/dixyes/awsl/pl/luajit | |
--[[ | |
gist: https://gist.github.com/dixyes/cd945d8a195889de32cb524254d90d33 | |
First to say : ffi niubi! | |
This file is ncursesw command line ui written in lua, using luajit and some C things. | |
Note: pits here: | |
1. variables created by ffi.new("sometype") may be gced at anytime (maybe use ffi.typeof() to create type can resolve this.); | |
workaround: use ffi.C.malloc instead | |
2. struct index may be not reliable: for example a structure struct sStruct{u32 lFirst; u64 llSecond;}; when use instSStruct[0].llSecond, it will use area from llSecond's half to out of bound 4 bytes as llSecond. |