Skip to content

Instantly share code, notes, and snippets.

View LuoZijun's full-sized avatar
🎯
Focusing

寧靜 LuoZijun

🎯
Focusing
View GitHub Profile
#![allow(non_camel_case_types, unused_variables, non_snake_case)]
pub type c_void = ();
pub type ULONG = u64;
pub type LONG = i64;
pub type HANDLE = *mut c_void;
pub type TUN_RING_PTR = *mut u8;
pub const TUN_RING_DEFAULT_CAPACITY: usize = 8388608; // 2**23 = 8MB
pub const TUN_RING_LEN: usize = std::mem::size_of::<TUN_RING_HEADER>() + TUN_RING_DEFAULT_CAPACITY + 0x10000;
@LuoZijun
LuoZijun / w.rs
Last active August 28, 2019 10:02
#![allow(non_camel_case_types, non_snake_case)]
pub const ANY_SIZE: usize = 1;
pub type DWORD = u32;
pub type USHORT = u16;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct MIB_IPADDRROW_XP {
// mio = "0.6"
// mio-named-pipes = "0.1"
extern crate mio;
extern crate mio_named_pipes;
use mio_named_pipes::NamedPipe;
use std::io::{self, Read, Write};
#![allow(unused)]
use std::path::Path;
use std::path::PathBuf;
use std::path::{Ancestors};
use std::fs::{OpenOptions, ReadDir,};
use std::io::{self, Read, Write};
use std::str::FromStr;
#[cfg(target_os = "linux")]
[package]
name = "audio"
version = "0.1.0"
authors = ["luozijun <luozijun.assistant@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
hound = "3.4"
@LuoZijun
LuoZijun / JS Sort.rst
Last active April 10, 2019 06:18
JS 大数组排序问题
页面

https://dev.w3.org/html5/html-author/charref

使用火狐或者谷歌浏览器打开上面这个页面,然后打开控制台,输入以下 ECMAScript 代码,运行后,发现排序结果并不对 ...

更新:查阅 Array.prototype.sort 文档后,发现这是 JS 会把数组里面的元素自动转换成字符串,然后毕竟字符串的 CodePoint 导致的(如果 sort 函数没有传递 比较函数的话)。

let dom = document.getElementsByTagName('table')[0].tBodies[0];
@LuoZijun
LuoZijun / README.rst
Last active April 10, 2019 05:46
星际争霸2:虚空之遗 - 亚顿之茅 过场动画
#![feature(int_to_from_bytes)]
extern crate mp4parse;
use std::fmt;
use std::fs::{ self, OpenOptions, };
use std::io::{ Read, Write, Seek, SeekFrom };
struct Chunks<'a> {
track: &'a mp4parse::Track,
@LuoZijun
LuoZijun / README.rst
Last active April 4, 2022 04:39
FFMPEG 添加时间戳水印

FFMPEG 添加时间戳水印

安装 FFMPEG

# 如果已安装的 FFMPEG 已经支持了 `freetype` ,那么就不需要再安装了。
import React from 'react'
import ReactDOM from 'react-dom'
import ApolloClient from "apollo-boost";
import gql from "graphql-tag";
import * as Antd from 'antd-mobile'
import * as ReactApollo from 'react-apollo';
const API_URI = "https://beta-ark.ecflag.net/graphql";
const APOLLO_CLIENT = new ApolloClient({