Skip to content

Instantly share code, notes, and snippets.

View sivinnguyen's full-sized avatar

Huy Vu~ sivinnguyen

View GitHub Profile
@sivinnguyen
sivinnguyen / blink_theme_gruvbox_dark.js
Last active December 10, 2022 11:23
Gruvbox dark theme for Blink shell
@sivinnguyen
sivinnguyen / ubuntu_touch_redmi_9a.md
Last active April 2, 2024 12:57
How to install Ubuntu Touch on Xiaomi Redmi 9A/9C (Draft)
@sivinnguyen
sivinnguyen / nvim_220406_configuration_android_termux.vim
Created April 6, 2022 12:30
Neovim's configuration for android termux
""""""""""""""""""""""""""""""""""
" Sivin's Neovim Configuration
" this version is for android termux
" ~/.config/nvim/init.vim
"
""""""""""""""""""""""""""""""""""
" Specify a directory for plugins
" - Avoid using standard Vim directory names like 'plugin'
@sivinnguyen
sivinnguyen / resources.md
Created March 15, 2022 16:42 — forked from ultrox/resources.md
Building Dactyl
@sivinnguyen
sivinnguyen / shell_20210527_videos_merging.md
Created May 27, 2021 07:30
Videos mearging for youtube uploading with chapters

Merge videos for youtube uploading

Calculate duration of videos then export to file

for mp4 in *.mp4
do
    l=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$mp4")
    echo $l ${mp4%.*}
done | awk '
@sivinnguyen
sivinnguyen / wsl2_200915_fix_dns_resolution.md
Last active April 12, 2024 07:30
Fix DNS resolution in WSL2

Error

$ sudo apt-get update
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Temporary failure in name rerolution

$ host google.com
;; connection timed out; no servers could be reached
@sivinnguyen
sivinnguyen / windows_200711_ssh_keygen.md
Created July 10, 2020 18:03
Generating a new SSH key and adding it to the ssh-agent

Generating a new SSH key

This creates a new ssh key, using the provided email as a comment(label). Ex: ssh-rsa AAA....== this_is_a_comment (email/hostname/etc.)

> ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
@sivinnguyen
sivinnguyen / php_200708_redirect.php
Last active July 10, 2020 18:04
Safely make A PHP Redirect
<?php
// cs-cart/addons/hybrid_auth/lib/Hybrid/Auth.php
// Ensure session is saved before sending response, see https://github.com/symfony/symfony/pull/12341
if ((PHP_VERSION_ID >= 50400 && PHP_SESSION_ACTIVE === session_status()) || (PHP_VERSION_ID < 50400 && isset($_SESSION) && session_id())) {
session_write_close();
}
// https://www.hostinger.com/tutorials/php-redirect
// https://www.tutorialrepublic.com/faq/how-to-make-a-redirect-in-php.php
// https://upcity.com/blog/6-how-to-redirect-your-site-properly/
@sivinnguyen
sivinnguyen / php_200708_curl_json.php
Last active July 10, 2020 18:04
POST and Receive JSON Data using PHP cURL
<?php
// More detail at https://www.codexworld.com/post-receive-json-data-using-php-curl
// API URL
$url = 'http://www.example.com/api';
// Create a new cURL resource
$ch = curl_init($url);
// Setup request to send json via POST
$data = array(
@sivinnguyen
sivinnguyen / csharp_190714_practice.cs
Last active July 10, 2020 18:04
C# Practice 190714
/*
Đề: Cho 1 list string đếm xem input nhập vào match bao nhiêu lần.
Ví dụ:
String[] arr =
{
"tôi thấy hoa vàng trên cỏ xanh",
"hôm nay tôi thấy hoa vàng",
"hoa vàng trên cỏ xanh, hoa vàng trên cỏ xanh"
}
Expectation: