Skip to content

Instantly share code, notes, and snippets.

View Hanaasagi's full-sized avatar
🌸

Hanaasagi

🌸
View GitHub Profile
from enum import Enum, auto
"""
START:
SIGN -> SIGN
DIGIT -> INT
"0" -> ZERO
"." -> P_DOT
ERROR -> ERROR
#!/usr/bin/env bash
set -eo pipefail
# hello-world latest ef872312fe1b 3 months ago 910 B
# hello-world latest ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9 3 months ago 910 B
# debian latest f6fab3b798be 10 weeks ago 85.1 MB
# debian latest f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd 10 weeks ago 85.1 MB
if ! command -v curl &> /dev/null; then
echo >&2 'error: "curl" not found!'
ffmpeg started on 2024-06-09 at 08:46:46
Report written to "ffmpeg-20240609-084646.log"
Log level: 56
Command line:
ffmpeg -i http://192.168.0.106:8000/input.mp4 -ss 23 -t 11.0 -y output.mp4 -loglevel trace -report
ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
configuration: --disable-debug --disable-doc --disable-ffplay --enable-cuvid --enable-ffprobe --enable-gpl --enable-libaom --enable-libass --enable-libfdk_aac --enable-libfreetype --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-nonfree --enable-nvdec --enable-nvenc --enable-opencl --enable-openssl --enable-stripping --enable-vaapi --enable-vdpau --enable-version3
li
Rust 36 hrs 26 mins ████████████████▋░░░░ 79.5%
YAML 3 hrs 33 mins █▋░░░░░░░░░░░░░░░░░░░ 7.8%
TOML 1 hr 55 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.2%
Markdown 1 hr 15 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.8%
JSON 51 mins ▍░░░░░░░░░░░░░░░░░░░░ 1.9%
#[derive(PartialEq, Eq, Clone, Debug)]
pub struct ListNode {
pub val: i32,
pub next: Option<Box<ListNode>>,
}
impl ListNode {
#[inline]
fn new(val: i32) -> Self {
ListNode { next: None, val }

TLP 1.4 Test: Battery Care for Lenovo Laptops (non-ThinkPad series)

Read the overview document first.

Supported Features

Lenovo laptop series using the ideapad_laptop driver have a feature called 'battery conservation mode', basically a fixed stop charge threshold at 60%. The hardware behaviour is:

  1. Connected to the charger, charging stops when the charge level reaches the stop threshold
@Hanaasagi
Hanaasagi / init.sh
Created December 8, 2021 14:30
initramfs-linux.img
#!/usr/bin/ash
udevd_running=0
mount_handler=default_mount_handler
init=/sbin/init
rd_logmask=0
. /init_functions
mount_setup
if "hello" == "hello":
print("correct")
else:
print("incorrect")
@Hanaasagi
Hanaasagi / is_big_endian.c
Created June 30, 2019 23:43
判断字节序,返回 true 为 Little-Endian 否则为 Big-Endian
int is_little_endian(void) {
union t
{
int a;
char b;
} c;
c.a = 1;
return c.b == 1;
}
// 如果为 big endian,存储为下(Hex表示,int 占 32 bit,char 占 8 bit)
@Hanaasagi
Hanaasagi / type-apply.py
Created April 8, 2019 02:19
一种通过 MonkeyType + Pytest 来自动注解的方法(准确率不高,仍需要人工修改)
```
python type-apply.py
```
import os
import subprocess
DIR = ""
for root, dirs, files in os.walk(DIR, topdown=False):