Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

VS Code Automatically Deleted Itself? Restore Everything in 2 Minutes

VS Code Disappeared? Restore Everything in 2 Minutes

Ever had that heart-stopping moment? You're ready to jump into your project, you click the familiar blue icon, and... nothing happens. You search for it. It's gone. Vanished. It feels like Visual Studio Code just packed its bags and left without a word.

If you're here, you've likely just experienced this tech nightmare. First, take a deep breath. You're not alone, and more importantly,  "your precious setup, your extensions, themes, and settings" is almost certainly safe.


This strange issue, often happening after a botched automatic update, leaves behind a ghost of an installation. The main application is gone, but your configuration is usually still hiding on your system.

Let's get you back up and running.


The Real Reason VS Code Disappeared

While it may seem like a digital ghost story, the most common culprit is often a failed update process. When VS Code attempts to update itself, it may create a temporary backup of the core files, delete the old ones, and then fail before it can replace them with the new ones. This leaves the main executable missing, causing the program to "disappear" from your system, even though your user data remains intact.


Your Step-by-Step Restoration Guide

Follow these simple steps carefully. This should take less than two minutes.


Step 1: Navigate to the VS Code Program Folder

Your first instinct might be to look in Program Files, but the user-level installation of VS Code lives in your AppData folder. The easiest way to get there is to use a shortcut.

  • Press Win + R on your keyboard to open the Run dialogue.
  • Type %LOCALAPPDATA% and press Enter.
  • This will open the Local folder inside your AppData. Now, navigate into the Programs folder, and then Microsoft VS Code.

The full path should look like this:

C:\Users\<YOUR_USERNAME>\AppData\Local\Programs\Microsoft VS Code\

(Pro-Tip: Replace <YOUR_USERNAME> with your actual Windows username if you're navigating manually.)


Step 2: Find the Hidden Backup Folder

Inside the Microsoft VS Code directory, you should see a strangely named folder, an underscore (_). This is the temporary folder created by the failed update process. It contains all the core files that went missing.


Step 3: Copy and Paste the Core Files

  • Double-click to open the _ folder.
  • Select everything inside it (Ctrl + A).
  • Copy all the files (Ctrl + C).
  • Return to the main Microsoft VS Code directory.
  • Paste everything you copied directly into this folder (Ctrl + V). Windows might ask you if you want to replace any files; choose "Yes" or "Replace the files in the destination."

By doing this, you are manually completing the update that failed.


Step 4: Reinstall VS Code (The Final Step!)

The files are now in the correct location, but Windows' registry and shortcuts may still be corrupted. The final step is to simply reinstall VS Code over your existing setup.

  • Go to the official Visual Studio Code download page.
  • Download the latest "System Installer" or "User Installer" for Windows (the User Installer is most common).
  • Run the installer. Do not uninstall anything. Simply run the new installer and allow it to complete the installation.

The installer will detect the existing files, repair the installation, fix your shortcuts, and restore your VS Code to full functionality.


Hurrah! Launch VS Code. You should find all your extensions, themes, and settings exactly as you left them. Your GitHub or Microsoft account should still be logged in, and your recent projects should be right there waiting for you.


Frequently Asked Questions (FAQ)


Q1: Will I lose all my installed extensions and themes?

A: No! This method specifically preserves your user data. Extensions, settings (settings.json), and keymaps are stored separately from the core program files and are restored accordingly.


Q2: How can I prevent this from happening again?

A: While you can't always prevent an update from failing, you can be prepared for it. Periodically backing up your settings using an extension like "Settings Sync" (now built into VS Code) is a great idea. Sync your settings to your GitHub or Microsoft account for easy recovery on any machine.


Q3: Does this work on Mac or Linux?

A: This specific file path is for Windows. However, the principle is the same. A failed update on Mac or Linux would require finding the application directory and performing a similar restoration, followed by a reinstall from the official .dmg or .deb/.rpm package.


Did this guide save your day? Do you have any other questions? Drop a comment below and let us know. Happy coding!

How To Deploy Private GitHub Repository To Any Hosting - CI/CD

Github to webhosting, automatic deployment, ci/cd deployment

GitHub to Web Hosting 

You can deploy private GitHub repo to cPanel, Hostinger, or any Web Hosting Manager. Automatic deployment for your CI/CD. This method will work for that. I'm a web developer by profession, I face this issue a lot until I find this method.

Deploying while cPanel Git version control you will face the issue "GitHub cannot access private repository" while submitting Github private repo unless until you setup a private key of cPanel to your GitHub Deploy keys.

Here you don't need to have SSH access or any root access for this method. All you need is an FTP ACCOUNT.

Let's start

In this method, I will be using the Deployment of GitHub Private Repo to cPanel.

1. You have to create an FTP account.
You need to setup the following details.
Log In: it will be the username
Domain: it will be your domain name.
Password: Write a password whatever you like. But keep it safe we will use re-use it, in github.
 
Create an FTP account

2
. In FTP Accounts, click on Configuration FTP Client, to get FTP Username and FTP Server Address.

FTP Accounts Details


3. Now go to your repository Settings > Secrets > Actions and click on New repository secret.
Now go to your repository Secrets > Actions and click on New repository secret

4. Now add a repository secret these details one by one.
Name: FTP_SERVER
Value: YOUR_FTP_SERVER_ADDRESS

Name: FTP_USERNAME
Value: YOU_FTP_USERNAME

Name: FTP_PASSWORD
Value: YOUR_FTP_PASSWORD
In my case its
Name: FTP_SERVER
Value: ftp.recmail.net

Name: FTP_USERNAME
Value: admin_github@blog.hit4visit.com

Name: FTP_PASSWORD
Value: s^E7tXj+O00U
Add a repository secret

5. Now add an action workflow. Change its name from main.yml to cPanelDepolyment.yml
    Copy the code below and add it to the workflow, click on start commit and then commit new file.
workflow commit


Version 1 code:

name: Publish Website to Web Hosting
on:
  push:
    branches:
      - main
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2.1.0
      with:
        fetch-depth: 2
    - name: FTP-Deploy-Action
      uses: SamKirkland/FTP-Deploy-Action@3.1.1
      with:
        ftp-server: ${{ secrets.FTP_SERVER }}
        ftp-username: ${{ secrets.FTP_USERNAME }}
        ftp-password: ${{ secrets.FTP_PASSWORD }}

Version 2 code:

name: Publish Website to Web Hosting V2
on:
  push:
    branches:
      - main
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/checkout@v2

    - name: 📂 Sync files
      uses: SamKirkland/FTP-Deploy-Action@4.3.0
      with:
        server: ${{ secrets.FTP_SERVER }}
        username: ${{ secrets.FTP_USERNAME }}
        password: ${{ secrets.FTP_PASSWORD }}
And boom, now you can do CI/CD of your project. Now, wait a few minutes until it deploys its initial code, after that once you push to the branch your setup, for older "master" or new version "main" or whatever you setup as default or you want its push to be updated, it will automatically update on your website. 

Video Tutorial


How To Create Simple Online Calculator In HTML

Simple Calculator In HTML

Am giving you a simple and easy calculator source code design by me. Its easy to modify you can modify it how you want to use it.

This Calculator Code will works on all types of browser. Let me teach you how this Online Calculator code is working and made. A form attribute name="FocDownloadsCalculator" is created, Input type which makes buttons and textfield. Here's the Eval() function is used which helps to evaluate the expression accordingly. Every input field has a attribute value. OnClick is the event, when a user click on it occurs.
Download source code

Java Programming In Hindi/Urdu [Complete Videos Tutorials]

Java Programming In Hindi/Urdu [Complete Videos Tutorials]

What is Java?

The high-level programming language developed by Sun Microsystems. Java was initially called OAK and was designed for handheld gadgets/devices and set-top boxes. Oak was unsuccessful so in 1995 Sun changed the name to Java and altered the language to leverage the growing World Wide Web.

C++ Complete Programming Videos Tutorials in Urdu/Hindi

C++ Complete Programming Video Tutorials in Urdu/Hindi
C++ (Known as C Plus Plus) is a programming language, which was designed by Bjarne Stroustrup in 1983. Now a days it is use for free form or compiling types of purposes. Extensions of C++ Programming .cpp, .cc, .c++, .cxx, .h, .hh, .h++, .hxx, .hpp etc.

C++ / C Plus Plus

C++ (C Plus Plus) Programming and .net are about the same, but in C++ you can create every type of simple and complex applications. Even C++ is using in creating of open source dynamic applications.

Here are some 36 videos tutorials.

Video # 01

Video # 02

Video # 03

Video # 04

Video # 05

Video # 06

Video # 07

Video # 08

Video # 09

Video # 10

Video # 11

Video # 12

Video # 13

Video # 14

Video # 15

Video # 16

Video # 17

Video # 18

Video # 19

Video # 20

Video # 21

Video # 22

Video # 23

Video # 24

Video # 25

Video # 26

Video # 27

Video # 28

Video # 29

Video # 30

Video # 31

Video # 32

Video # 33

Video # 34

Video # 35

Video # 36