Skip to content

Instantly share code, notes, and snippets.

View nguyenhuutuananh's full-sized avatar
🛠️
Fighting

Tuân Anh Nguyễn nguyenhuutuananh

🛠️
Fighting
View GitHub Profile
@fernandoaleman
fernandoaleman / mysql-8.0-gpg-fix.md
Last active June 20, 2025 09:50
The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.

Problem

The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.

Solution

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
@thimslugga
thimslugga / 01_setup-docker-al2023.md
Last active June 22, 2025 09:25
Setup Docker on Amazon Linux 2023

Setup Docker on Amazon Linux 2023

The following guide is for setting up Docker with docker-compose v2 on Amazon Linux 2023. The steps are intendend for AL2023 on EC2 but should mostly work for the AL2023 VMs running on other hypervisors.

Install and configure Docker on Amazon Linux 2023

Install Base OS Packages

Install the following packages, which are good to have installed:

@tatsuyasusukida
tatsuyasusukida / !README-javascript-audio.md
Last active June 9, 2025 14:28
🎵 How to record audio using the Web Audio API in JavaScript

🎵 How to record audio using the Web Audio API in JavaScript

Demo video: How to record audio using the Web Audio API in JavaScript

About this article

This article describes how to record audio using the Web Audio API in JavaScript. The related resources are shown below.

@ramingar
ramingar / vue-debug-webstorm.md
Created December 12, 2018 11:00
Webstorm Vue Debugging #vue #debug #webstorm
@npearce
npearce / install-docker.md
Last active May 21, 2025 14:32
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@soulmachine
soulmachine / jwt-expiration.md
Last active June 19, 2025 15:38
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@jesstelford
jesstelford / event-loop.md
Last active June 2, 2025 05:57
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@RadGH
RadGH / short-number-format.php
Last active February 25, 2025 21:33
Short Number Formatter for PHP (1000 to 1k; 1m; 1b; 1t)
<?php
// Converts a number into a short version, eg: 1000 -> 1k
// Based on: http://stackoverflow.com/a/4371114
function number_format_short( $n, $precision = 1 ) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {
@jkubacki
jkubacki / gist:e2dd904bd648b0bd4554
Created January 21, 2015 18:47
Mac uninstall elasticsearch
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep elasticsearch
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl remove homebrew.mxcl.elasticsearch
pkill -f elasticsearch
@staltz
staltz / introrx.md
Last active June 18, 2025 06:22
The introduction to Reactive Programming you've been missing