Skip to content

Instantly share code, notes, and snippets.

View Lincest's full-sized avatar
🏸
A small piece of matter

Moreality Lincest

🏸
A small piece of matter
View GitHub Profile
@Lincest
Lincest / ffmpeg
Created August 8, 2020 01:29
ffmpeg合并音视频
ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 output.mp4
@Lincest
Lincest / whiteSquare.py
Last active August 20, 2020 15:22
将图片填充成正方形白底( 发微博? )
from PIL import Image
import os
# JPG文件
def jpg_square(im, min_size=256, fill_color=(255, 255, 255)):
x, y = im.size
size = max(min_size, x, y)
new_im = Image.new('RGB', (size, size), fill_color)
new_im.paste(im, (int((size - x) / 2), int((size - y) / 2)))
return new_im
@Lincest
Lincest / Dijkstra.cpp
Last active March 8, 2021 14:23
Dijkstra
/**
* author: roccoshi
* created: 2021-03-08 21:34:14
* description:
dijkstra + priority_queue
test_cases:
node1 node2 distance
[[1,2,3],[1,3,3],[2,3,1],[1,4,2],[5,2,2],[3,5,1],[5,4,10]]
*/
#pragma GCC diagnostic ignored "-Wsign-conversion"
@Lincest
Lincest / BIG_CAL.cpp
Last active July 22, 2021 02:40
高精度
/*
高精度加减乘除类:
@param: 倒序的两个高精度数组
@return: 字符串表示的结果
*/
/* --------- 高精度加法 ----------- */
string bigadd(vector<int>& a, vector<int>& b) {
if (a.size() < b.size()) return bigadd(b, a);
@Lincest
Lincest / .ideavimrc
Last active August 11, 2024 02:45
.ideavimrc
" 一些基础设置
set number
set relativenumber
set ruler
set laststatus=2
set hlsearch
set incsearch
set showmode
set showcmd
" 模式查找忽略大小写
@Lincest
Lincest / actionlist.vim
Created November 2, 2021 07:39 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@Lincest
Lincest / niz-config.pro
Last active January 18, 2022 11:06
宁芝x87的配置文件, 实现了类似capslock+的效果
<?xml version="1.0" encoding="UTF-8"?>
<X87EC(S)BLe>
<PredefinedCombo>
<List SizeOfView="6" ViewStartAt="1" CursorPos="5" Cycles="1" IsAutoInterval="0" Delay="30" PlayMode="0">
<x ID="0" t1="选中到行末">
<List SizeOfView="6" ViewStartAt="0" CursorPos="1" Cycles="1" IsAutoInterval="0" Delay="30" PlayMode="0">
<x ID="0" t1="LSHIFT">
<List SizeOfView="6" ViewStartAt="0" CursorPos="0" Cycles="1" IsAutoInterval="0" Delay="30" PlayMode="0"/>
</x>
<x ID="1" t1="END">
PIN's Not Pinned.
@Lincest
Lincest / karabiner.json
Last active May 6, 2024 07:10
karabiner capslock
{
"title": "Moreality: Karabiner-Capslock+",
"url": "https://gist.githubusercontent.com/Lincest/a43dd5495728ce5f43150c76d5ce92bc/raw",
"version": "3.0.3",
"maintainers": [
"Moreality"
],
"author": "roccoshi(imroccoshi@gmail.com)",
"website": "https://roccoshi.top",
"import_url": "karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/Lincest/a43dd5495728ce5f43150c76d5ce92bc/raw",
@Lincest
Lincest / README.md
Created April 23, 2023 02:56 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]