Skip to content

Instantly share code, notes, and snippets.

View fecoderchinh's full-sized avatar
🤏
I may be slow to respond.

just a Coder guy fecoderchinh

🤏
I may be slow to respond.
View GitHub Profile
@fecoderchinh
fecoderchinh / debounce.js
Created November 19, 2023 08:02
Javascript Debounce & Throttle
// Executing the callback after number of milliseconds.
const debound = (callback, delay) => {
let timeout = 0;
return (...args) => {
clearTimeout(timeout);
timeout = setTimeout(() => {
callback(...args);
}, delay);
}
@fecoderchinh
fecoderchinh / chat.gateway.js
Created October 11, 2023 10:51
Nestjs Websocket - Emitting an event within a service
@WebSocketGateway()
export class ChatGateway
implements OnGatewayInit
{
constructor(
private roomService: RoomService
) {}
@WebSocketServer()
public server: Server = new Server();
@fecoderchinh
fecoderchinh / locate_docker_volumes_on_Windows.md
Created July 1, 2022 14:57
Locating data volumes in Docker Desktop (Windows)

Solution 1:

The original reference

Type in the Windows file explorer :

  • For Docker Engine v20.10.16: \\wsl$\docker-desktop-data\data\docker\volumes
  • For Docker Engine v19.03: \\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\

You will have one directory per volume.

@fecoderchinh
fecoderchinh / move_repo_from_bitbucket_to_github.md
Created July 1, 2022 06:24
How to move repository from Bitbucket to GitHub with all branches and commits?

The original reference

Step 1 : Create a Blank repository on Github without Readme.md

Step 2 : Moving all code and content from bitbucket

  1. Check out the existing repository from Bitbucket: git clone https://<Bitbucket_Username>@bitbucket.org/<Bitbucket_Username>/<Repo_Name>.git
  2. Now adding new GitHub Repository as upstream remote of the repository which is clone from bitbucket. cd <Repo_Name> git remote add upstream https://github.com/<Bitbucket_Username>/<Repo_Name>.git
  3. push all branches and tags to GitHub Repository using below commands
@fecoderchinh
fecoderchinh / fix_bitbucket_authentication.md
Created July 1, 2022 06:18
How to fix remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication error?

The original reference

Step 1: Create an App Password in BitBucket

  1. Go to the bitbucket.org website and log in with your account credentials
  2. From your avatar in the bottom left, click Personal settings
  3. Click App passwords under Access management
  4. Click Create App password
  5. Give the app password sufficient rights and a label related to the application that will use the password
  6. Don’t forget to save that password