Skip to content

Instantly share code, notes, and snippets.

View shawnfeng0's full-sized avatar
💭
Keep thinking

Shawn Feng shawnfeng0

💭
Keep thinking
View GitHub Profile
@cshaa
cshaa / Shell_ContextMenu_GitHub.reg
Last active December 26, 2023 05:43
Create neat sub-menus for Windows Explorer directory right-click, one for the Command Line, one for PowerShell and one for Git
Windows Registry Editor Version 5.00
; GitHub Desktop
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\github]
; "Icon"=(REG_EXPAND_SZ)"%LocalAppData%\\GitHubDesktop\\GitHubDesktop.exe"
"Icon"=hex(2):25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,00,65,00,\
73,00,6b,00,74,00,6f,00,70,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,\
00,65,00,73,00,6b,00,74,00,6f,00,70,00,2e,00,65,00,78,00,65,00,00,00
@mkasberg
mkasberg / loundorm.py
Last active April 29, 2022 07:09 — forked from kylophone/loudness.rb
FFmpeg loudnorm filter - dual pass loudness normalization example - http://k.ylo.ph/2016/04/04/loudnorm.html
#!/usr/bin/env python
import json
import os
from subprocess import check_call, check_output, STDOUT
import sys
if len(sys.argv) != 3:
print "Usage: %s input.wav output.wav" % __file__
sys.exit(1)
@xymopen
xymopen / linux_magic.cpp
Created October 17, 2017 14:00
C++ equivalences of the famous offset_of and container_of(owner_of) macro from Linux kernel
template< class T, class M >
static inline constexpr ptrdiff_t offset_of( const M T::*member ) {
return reinterpret_cast< ptrdiff_t >( &( reinterpret_cast< T* >( 0 )->*member ) );
}
template< class T, class M >
static inline constexpr T* owner_of( M *ptr, const M T::*member ) {
return reinterpret_cast< T* >( reinterpret_cast< intptr_t >( ptr ) - offset_of( member ) );
}
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd]
"MUIVerb"="@shell32.dll,-8506"
"Extended"=""
"Icon"="cmd.exe"
"SubCommands"="cmd.cmd;cmd.msys2_msys;cmd.msys2_mingw32;cmd.msys2_mingw64"
[HKEY_CLASSES_ROOT\Directory\shell\cmd]
"MUIVerb"="@shell32.dll,-8506"
@pce
pce / shell-tools.md
Last active August 7, 2019 18:09
shell-tools
@connorjan
connorjan / rsub.md
Last active January 4, 2025 04:57
Editing Files Remotely via SSH on SublimeText 3

Editing Files Remotely via SSH on SublimeText 3

Sometimes you need to edit a file on a remote server, but using vim/emacs is not very practical, due to lag and speed of screen refresh.

TextMate users have the classic rmate, but it was implemented in Ruby, which may not be available on the remote server.

A better option is to use this version of rmate, implemented in pure Bash. It's a single file, self-contained, and with no external dependencies.

Step by step:

@nickoala
nickoala / orbslam2_ubuntu_mate.md
Created December 12, 2016 12:20
Build ORB-SLAM2 on Raspberry Pi 3

Build ORB-SLAM2 on Raspberry Pi 3

Operating system: Ubuntu Mate 16.04

I use Ubuntu Mate instead of the usual Raspbian Jessie mainly because of the gcc version. ORB-SLAM2 requires C++11 support. Raspbian comes with gcc 4.9, which does not handle C++11 by default. That means you have to play around with some compiler flags in ORB-SLAM2's CMakeLists.txt to make it work. In contrast, Ubuntu Mate's gcc 5.4 handles C++11 naturally.

@khancyr
khancyr / CMakeLists.txt
Last active October 16, 2024 12:03
Ardupilot clion
cmake_minimum_required(VERSION 3.5)
project(Ardupilot)
add_compile_options(-std=c++11)
set(TARGET_PLATFORM sitl)
#set(TARGET_PLATFORM chibios)
#set(TARGET_PLATFORM linux)
string(TOUPPER ${TARGET_PLATFORM} TARGET_PLATFORM_UPPER)
# To work with SITL
Pty Language Age/Gender VoiceName File Other Languages
2 en-gb M english en (en-uk 2)(en 2)
3 en-uk M english-mb-en1 mb/mb-en1 (en 2)
2 en-us M english-us en-us (en-r 5)(en 3)
5 en-sc M en-scottish other/en-sc (en 4)
5 en M default default
5 en-uk-north M english-north other/en-n (en-uk 3)(en 5)
5 en-uk-rp M english_rp other/en-rp (en-uk 4)(en 5)
5 en-us M us-mbrola-2 mb/mb-us2 (en 7)
5 en-us F us-mbrola-1 mb/mb-us1 (en 8)
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 7, 2025 01:38 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: