Skip to content

Instantly share code, notes, and snippets.

View 7sDream's full-sized avatar
😪
I'm not sleepy!

7sDream 7sDream

😪
I'm not sleepy!
View GitHub Profile
@7sDream
7sDream / rust-font-libs.md
Last active May 11, 2024 11:23
Pure rust font render library feature comparison

Pure rust font rendering related library comparison

Update time: 2024-05-11

Dev related

[read-fonts] [skrifa] [ttf-parser] [rustybuzz] [ab_glyph] [glyph_brush] [fontdue] [allsorts] [swash] [cosmic-text]
API Level L M L/M L H H H H M/H H
Minimal Deps × × ×
@7sDream
7sDream / convert.js
Created October 16, 2023 10:09
Converting Insomnia collection to httpYac project
// This script convert Insomnia export json file(v4) into a HttpYac project.
// Only tested for http requests. gRPC, GraphQL, SSE or other request type may not work.
const fs = require("fs");
const util = require("util");
const insomnia = JSON.parse(fs.readFileSync("insomnia.json")).resources;
const itemMap = new Map(insomnia.map(item => [item._id, item]));
const cleanFilename = (s) => s.replace(/[/\\?%*:|"<>]/g, "-");
@7sDream
7sDream / with-env.ps1
Last active January 9, 2023 23:44 — forked from kizzx2/with-env.ps1
Run command with environment variables in PowerShell
function With-Env {
$ori = @{}
Try {
$i = 0
# Loading .env files
# if (Test-Path $args[0]) {
# foreach ($line in (Get-Content $args[0])) {
# if ($line -Match '^\s*$' -Or $line -Match '^#') {
# continue
@7sDream
7sDream / ffmpeg_bilibili.sh
Last active August 27, 2023 18:46
Convert video to meet bilibili's requirement. Video: 1080p60, H264, avg bitrate 6k, max bitrate 24k, max key frame interval 10s; Audio: aac, 44100Hz, 192k. With optional GPU acceleration support.
#!/bin/bash
# ===== setting =====
FORMAT=mp4
VIDEO_CODEC=libx264
VIDEO_GPU_CODEC=h264_videotoolbox
PROFILE=high
LEVEL=4.2
PRESET=veryslow
@7sDream
7sDream / togif.sh
Created March 6, 2019 09:50
togif.sh
#!/bin/bash
if [ "$#" -lt 2 ]; then
echo "Usage: $0 videofile output fps width start duration"
exit 1
fi
VIDEO=$1
OUTPUT=$2
FPS=$3

Keybase proof

I hereby claim:

  • I am 7sdream on github.
  • I am 7sdream (https://keybase.io/7sdream) on keybase.
  • I have a public key whose fingerprint is B37B 94A8 E2B8 AB65 FE71 731A 72A6 D9FC EDDA B75D

To claim this, I am signing this object:

@7sDream
7sDream / dvm.fish
Last active April 26, 2017 23:46
Set up dvm command for fish shell.
# Docker Version Manager wrapper for *nix
# Implemented as a POSIX-compliant function
# Should work on sh, dash, bash, ksh, zsh
# To use, source this file from your bash profile
begin # This ensures the entire script is downloaded
set DVM_SCRIPT_SOURCE $_
# __dvm_has() {
# type "$1" > /dev/null 2>&1