Skip to content

Instantly share code, notes, and snippets.

View tuyendq's full-sized avatar
🎯
Practice until you can't make it wrong

DANG QUOC TUYEN tuyendq

🎯
Practice until you can't make it wrong
View GitHub Profile
@tuyendq
tuyendq / googlesheets.gs
Last active October 18, 2023 16:42
Google Sheets commonly used functions
/**
* Delete columns and rows
*/
function DeleteColumnsAndRows() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getSheetByName("SHEET-NAME-HERE");
// sheet.getRange(1, 2, sheet.getMaxRows(), sheet.getMaxRows()).activate();
// Delete column B to max
if (sheet.getMaxColumns() > 1) {
@tuyendq
tuyendq / yt-dlp.md
Last active November 7, 2023 01:39
yt-dlp - forked from youtube-dl

Install yt-dlp on Windows

winget install yt-dlp

Install ffmpeg

winget install ffmpeg
@tuyendq
tuyendq / set-permission-sshprivatekey.cmd
Created June 13, 2020 11:21
Set permission SSH Private Key File
:: Set key variable as full path the the private key id_rsa file ::
:: set key="%userprofile%\.ssh\id_rsa"
set keyname="ocifree"
set key=%~dp0%\%keyname%
:: Remove default inheritance ::
cmd /c icacls %key% /c /t /inheritance:d
:: Set ownership to the owner ::
@tuyendq
tuyendq / O365.ps1
Last active September 28, 2022 15:24
Office 365
$today = Get-Date -Format yyyyMMdd
# Install the Microsoft Graph Powershell module
Install-Module Microsoft.Graph
# Install the Microsoft Azure AD module
Install-Module AzureAD
# Using credential
$credential = Get-Credential
@tuyendq
tuyendq / set-env-path
Created June 1, 2020 11:09
Powershell - Path environment
# Add PERMENANT entry to %PATH% environment variable - Add to Registry
$addToPath = "C:\Program Files\Amazon\AWSCLIV2"
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$newPath = "$currentPath;$addToPath"
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
@tuyendq
tuyendq / blogger-qrcode.txt
Created August 12, 2018 13:09
Add QR Code of post'url at the end of post's content
<!-- Post URL QR Code-->
<div>
<img expr:alt='&quot;QR Code of &quot; + data:post.title' expr:src='&quot;https://chart.googleapis.com/chart?chs=120x120&amp;cht=qr&amp;chl=&quot; + data:post.url + &quot;&amp;choe=UTF-8&quot;'/>
</div>
<table>
<caption style="caption-side:bottom;" >Caption here</caption>
<thead>
<tr>
<th>Header1</th>
<th>Header2</th>
</tr>
</thead>
<tbody>
<tr>