Skip to content

Instantly share code, notes, and snippets.

View sawaYch's full-sized avatar
🐧
Focusing

Sawa sawaYch

🐧
Focusing
View GitHub Profile
@sawaYch
sawaYch / yt-dlp.md
Last active April 20, 2024 07:52
yt-dlp readme

yt-dlp usage

# check format & codec
yt-dlp -F https://www.youtube.com/watch?v=vWsmn3-7scs
# output
[info] Available formats for vWsmn3-7scs:
ID  EXT RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC      ABR ASR MORE INFO
────────────────────────────────────────────────────────────────────────────────────────────────────────────
139 m4a audio only     │ ~ 66.18MiB   64k dash  │ audio only        mp4a.40.5   64k 22k DASH audio, m4a_dash
140 m4a audio only     │ ~148.90MiB  144k dash  │ audio only        mp4a.40.2  144k 44k DASH audio, m4a_dash
@sawaYch
sawaYch / drop_all_tables.sql
Created July 29, 2022 10:19
recursively drop all table (with FK constraint) on MSSQL DB
## create foreach storeprocedure first. If your db exist, then no need to do it.
CREATE proc [dbo].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
AS
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)
@sawaYch
sawaYch / README.md
Created February 10, 2022 07:03
fix mac book dark screen and always boot to recovery assistant

This really scare me :/

The solution is to reset macbook's NVRAM / PRAM: https://support.apple.com/en-us/HT204063

  1. remember press Option + Command + P + R when the machine boot when you hear the first boot sound
  2. holding it around 20 seconds, until you hear second boot sound
  3. machine will boot
  4. success
@sawaYch
sawaYch / alacritty.yml
Last active January 12, 2022 21:36
Alacritty terminal configuration
env:
TERM: xterm-256color
cursor:
style: Block
font:
normal:
family: Source Code Pro for Powerline
size: 14
@sawaYch
sawaYch / aad-token-lifetime-payload.md
Last active December 22, 2021 04:53
Azure AD token lifetime payload

AAD Token lifetime payload

  1. Token Lifetime policy is apply to resource server (e.g. backend server app registration)
  2. Refresh Token lifetime is not use TokenLifeTimePolicy to config, but use conditional access sign-in frequency
{
  "TokenLifetimePolicy": {
    "Version": 1,
 "AccessTokenLifetime": "00:10:00",
@sawaYch
sawaYch / meter-config-regex-fuckup.md
Last active December 22, 2020 03:45
npm install react native, meter config regex-fuckup on Windows. here is the link to workaround.

expo/expo-cli#1074

Got this issue today on windows, but don't need to downgrade node, just as discussed on stackoverflow just need to change some hashes on your project:

\node_modules\metro-config\src\defaults\blacklist.js
var sharedBlacklist = [
  /node_modules[/\\]react[/\\]dist[/\\].*/,
 /website\/node_modules\/.*/,
@sawaYch
sawaYch / githubStat.md
Last active November 18, 2020 21:53
Sawa's githubStat card
We couldn’t find that file to show.
@sawaYch
sawaYch / c_cpp_properties.json
Last active August 28, 2020 20:04
Vscode C/C++ config for QMK+MSYS2
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/*",
"${workspaceFolder}/**",
"C:/msys64/home/sawa/qmk_utils/avr8-gnu-toolchain/avr/include/*",
"C:/msys64/home/sawa/qmk_utils/avr8-gnu-toolchain/avr/include/**",
"C:/msys64/home/sawa/qmk_utils/avr8-gnu-toolchain/lib/gcc/avr/8.3.0/include-fixed/*",
@sawaYch
sawaYch / kde_hdmi_analog_switch.md
Last active November 17, 2020 08:52
Config alsamixer profile for KDE Neon (Phonon)

Description:
When headphone(analog) and HDMI connect to monitor, kde cannot auto switch audio to headphone.
What can we do is use plasmoid to adjust the audio channel manually.
Add the profile to /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf.

sudo vim /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf


[Profile ouput:analog-stereo+output:hdmi-stereo]