Skip to content

Instantly share code, notes, and snippets.

View WANGJIEKE's full-sized avatar
🖥️
Coding

Tongjie Wang WANGJIEKE

🖥️
Coding
View GitHub Profile
@WANGJIEKE
WANGJIEKE / ffmpeg_cmd.sh
Last active January 27, 2023 06:11
My FFmpeg Command Collection
View ffmpeg_cmd.sh
# Source: https://stackoverflow.com/a/59307017
# Merge two audio track into one
ffmpeg -i originalfile.mov -c:v copy -c:a aac -b:a 160k -ac 2 -filter_complex amerge=inputs=2 output.mp4
# Source: https://stackoverflow.com/a/36120894
# Get last x second
ffmpeg -sseof -10 -i input.mp4 output.mp4
# Source: https://superuser.com/a/933310
# Reduce file size
@WANGJIEKE
WANGJIEKE / my_cfg.cfg
Created January 3, 2021 11:09
My CS:GO CFG
View my_cfg.cfg
bind mwheelup +jump
bind mwheeldown +jump
alias "+jumpthrow" "+jump;-attack";
alias "-jumpthrow" "-jump";
bind alt "+jumpthrow"
alias "+score_net_graph" "+showscores; net_graphheight 0";
alias "-score_net_graph" "-showscores; net_graphheight 10000";
bind tab "+score_net_graph"
@WANGJIEKE
WANGJIEKE / no_ctrl_s_grammarly.js
Created July 6, 2020 22:00
Ignore Ctrl/Cmd-S when using Grammarly, so no more annoying saving webpage dialog
View no_ctrl_s_grammarly.js
// ==UserScript==
// @name Ignore Ctrl/Cmd-S on Grammarly
// @namespace https://wangjieke.github.io/
// @version 0.1
// @description Ignore Ctrl/Cmd-S on Grammarly
// @author WANGJIEKE
// @match https://app.grammarly.com/ddocs/*
// @grant none
// ==/UserScript==
@WANGJIEKE
WANGJIEKE / mkv2mp4.py
Created June 25, 2020 19:42
Convert mkv to mp4
View mkv2mp4.py
#!/usr/bin/env python3
"""
mkv2mp4.py
This script needs MKVToolNix and FFmpeg to run
"""
USAGE = 'usage: mkv2mp4.py INPUT'
from pathlib import Path
@WANGJIEKE
WANGJIEKE / csv2xlsx.ps1
Last active February 24, 2020 01:11
Convert csv to xlsx
View csv2xlsx.ps1
$excel = New-Object -ComObject Excel.Application
$excel.Visible = $false
ForEach ($dir in $args) {
Write-Output "Converting all csv to xlsx inside $(Resolve-Path $dir)..."
Get-ChildItem -Path $(Resolve-Path $dir) | ForEach {
if ($_.Extension -ne ".csv") {
continue
}
@WANGJIEKE
WANGJIEKE / flv2mp4.sh
Created February 1, 2020 22:17
Convert FLV file to MP4 with FFmpeg
View flv2mp4.sh
for i in *.flv;
do ffmpeg -i "$i" -c copy "${i%.*}.mp4";
done
View disable_device_credential_guard.ps1
bcdedit /set hypervisorlaunchtype off
@WANGJIEKE
WANGJIEKE / gbk2utf8.py
Created September 10, 2019 10:21
GBK to UTF-8 in Python 3
View gbk2utf8.py
#!/usr/bin/env python3
from typing import Optional
import os
import fire
def gbk2utf8(path: str, out: Optional[str]='utf8_out.txt') -> None:
"""Convert file encoded in GBK into UTF-8
@WANGJIEKE
WANGJIEKE / config-highlight.cfg
Last active June 13, 2019 06:38 — forked from AndBondStyle/config-highlight.cfg
A dark highlighting theme for Python's IDLE IDE based on PyCharm Darcula color scheme
View config-highlight.cfg
[Darcula]
normal-foreground = #A9B7C6
normal-background = #2B2B2B
definition-foreground = #A9B7C6
definition-background = #2B2B2B
keyword-foreground = #CC7832
keyword-background = #2B2B2B
builtin-foreground = #8888C6
builtin-background = #2B2B2B
string-foreground = #507842