Jump to content

Literally all of my code disappeared [discord.js]

Saddy
Go to solution Solved by zwirek2201,

Don't write anything to disk, run something jak EaseUs Data Recpvery and pray to computer gods. Next time use git or at least cloud.

For the past three days I spent a total of 24 hours working on a discord bot, only for me to open it and have everything gone. It is literally blank. All my other code is still there, just my main code with everything in it is gone. Anyone know any way to get it back before I giphy.gif

--------------------------------------------------------------------------------------

If this post solved your problem, please press the check below :).

--------------------------------------------------------------------------------------

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Saddy said:

For the past three days I spent a total of 24 hours working on a discord bot, only for me to open it and have everything gone. It is literally blank. All my other code is still there, just my main code with everything in it is gone.

That's why you should be using source control...

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Don't write anything to disk, run something jak EaseUs Data Recpvery and pray to computer gods. Next time use git or at least cloud.

Try, fail, learn, repeat...

Link to comment
Share on other sites

Link to post
Share on other sites

 I had no backup as I was going to configure that tonight

--------------------------------------------------------------------------------------

If this post solved your problem, please press the check below :).

--------------------------------------------------------------------------------------

Link to comment
Share on other sites

Link to post
Share on other sites

Well I'm going to go cry in a corner for a few hours, and then make another bot. 

--------------------------------------------------------------------------------------

If this post solved your problem, please press the check below :).

--------------------------------------------------------------------------------------

Link to comment
Share on other sites

Link to post
Share on other sites

9 minutes ago, Saddy said:

Well I'm going to go cry in a corner for a few hours, and then make another bot. 

And we still need a hug emoji.... the sad face of "I feel ya bro" will have to do: :(

Intel HEDT and Server platform enthusiasts: Intel HEDT Xeon/i7 Megathread 

 

Main PC 

CPU: i9 7980XE @4.5GHz/1.22v/-2 AVX offset 

Cooler: EKWB Supremacy Block - custom loop w/360mm +280mm rads 

Motherboard: EVGA X299 Dark 

RAM:4x8GB HyperX Predator DDR4 @3200Mhz CL16 

GPU: Nvidia FE 2060 Super/Corsair HydroX 2070 FE block 

Storage:  1TB MP34 + 1TB 970 Evo + 500GB Atom30 + 250GB 960 Evo 

Optical Drives: LG WH14NS40 

PSU: EVGA 1600W T2 

Case & Fans: Corsair 750D Airflow - 3x Noctua iPPC NF-F12 + 4x Noctua iPPC NF-A14 PWM 

OS: Windows 11

 

Display: LG 27UK650-W (4K 60Hz IPS panel)

Mouse: EVGA X17

Keyboard: Corsair K55 RGB

 

Mobile/Work Devices: 2020 M1 MacBook Air (work computer) - iPhone 13 Pro Max - Apple Watch S3

 

Other Misc Devices: iPod Video (Gen 5.5E, 128GB SD card swap, running Rockbox), Nintendo Switch

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Saddy said:

Well I'm going to go cry in a corner for a few hours, and then make another bot. 

I very recently lost my whole database with about 30 tables and many views and stored procedures so I feel ya bro. Now I'm running a custom script that backs up my database every time I turn on my PC and uploads every single version to the cloud. Yes, it's an overkill and no, I ain't loosing this shit second time. It took me multiple days to restore it from the code that was accessing it in the application. It was a pain in the ass let me tell ya. 

 

32 minutes ago, Cruorzy said:

Dont do shit, till you learn Git..

Can't agree more. It's not as difficult as it seems and can save your ass many, many times.

 

Try, fail, learn, repeat...

Link to comment
Share on other sites

Link to post
Share on other sites

@Nuluvius Speaks the truth. Source control is your life line as a programmer. Git, SVN, Perforce, even simply backing up files after every iteration is better than nothing.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, Cruorzy said:

Dont do shit, till you learn Git..

Or even just make a copy of stuff if you can't be bothered learning git / svn / any other VCS :)

Intel i7 5820K (4.5 GHz) | MSI X99A MPower | 32 GB Kingston HyperX Fury 2666MHz | Asus RoG STRIX GTX 1080ti OC | Samsung 951 m.2 nVME 512GB | Crucial MX200 1000GB | Western Digital Caviar Black 2000GB | Noctua NH-D15 | Fractal Define R5 | Seasonic 860 Platinum | Logitech G910 | Sennheiser 599 | Blue Yeti | Logitech G502

 

Nikon D500 | Nikon 300mm f/4 PF  | Nikon 200-500 f/5.6 | Nikon 50mm f/1.8 | Tamron 70-210 f/4 VCII | Sigma 10-20 f/3.5 | Nikon 17-55 f/2.8 | Tamron 90mm F2.8 SP Di VC USD Macro | Neewer 750II

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, Fetzie said:

Or even just make a copy of stuff if you can't be bothered learning git / svn / any other VCS :)

Thing is you still might have huge gaps of missing code if not saved for a while, if you learn yourself  to commit and push on a regular bases.

You will be alot safer.

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, Fetzie said:

Or even just make a copy of stuff if you can't be bothered learning git / svn / any other VCS :)

If you 'can't be bothered learning' (especially how to do things properly) then I'd strongly suggest that writing software is not something that you should be spending your time doing. I'd suggest that you go and find something that you can be bothered to do and expend your efforts there instead.

 

I shall reiterate then for the sake of clarity; this is terrible advice.

Just now, Cruorzy said:

commit and push on a regular bases

Indeed and the most optimal strategy is to make small granular commits of work.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

@Nuluvius Be easy on him :D But can't agree more to learn a VCS.

 

@Saddy

Actually git is quite fun when you work alone specially and dont have to worry about merge conflicts that often etc.

 

It will give you fun stats like how many commits you did etc, overview of everything you did. 

 

For example i find fun to look at is when im doing most of the work as a (hobby script kiddie).

With bitbucket there is a punchcard snap in, there you can see that i am useless in the morning and midday its alrighty. Mostly in the evening i would be Gaming and between PUBG deaths do some work. Looks like i die hell alot.

commits.png.6229b8a70cbd22f59baf151bafaf9467.png

 

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, Nuluvius said:

If you 'can't be bothered learning' (especially how to do things properly) then I'd strongly suggest that writing software is not something that you should be spending your time doing. I'd suggest that you go and find something that you can be bothered to do and expend your efforts there instead.

 

I shall reiterate then for the sake of clarity; this is terrible advice.

Indeed and the most optimal strategy is to make small granular commits of work.

Simply having a copy would have been useful though (I mirror my local stuff to a second drive so that I have a backup even if the Internet goes down or I have a git brainfart). Especially if you have not yet set up said vcs.

 

Also, I never fucking said that the OP should not use a vcs so you can cut the high and mighty attitude.

Intel i7 5820K (4.5 GHz) | MSI X99A MPower | 32 GB Kingston HyperX Fury 2666MHz | Asus RoG STRIX GTX 1080ti OC | Samsung 951 m.2 nVME 512GB | Crucial MX200 1000GB | Western Digital Caviar Black 2000GB | Noctua NH-D15 | Fractal Define R5 | Seasonic 860 Platinum | Logitech G910 | Sennheiser 599 | Blue Yeti | Logitech G502

 

Nikon D500 | Nikon 300mm f/4 PF  | Nikon 200-500 f/5.6 | Nikon 50mm f/1.8 | Tamron 70-210 f/4 VCII | Sigma 10-20 f/3.5 | Nikon 17-55 f/2.8 | Tamron 90mm F2.8 SP Di VC USD Macro | Neewer 750II

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Fetzie said:

Simply having a copy would have been useful though (I mirror my local stuff to a second drive so that I have a backup even if the Internet goes down or I have a git brainfart).

Nothing should be kept locally at all and indeed never in one place for that matter. My own personal strategy, which is very similar to my workplace strategy, is to keep everything on a NAS with one disk fault tolerance which is backed up and asymmetrically replicated to the cloud. Each client is kept as thin as is possible i.e. only session data and any granular uncommitted pieces of code or work. My network is also partitioned in such a way as to protect against incursions and also to minimise damage in the event that one does occur. If any client were to go down for any reason then there's virtually no data loss and the downtime is very minimal.

1 hour ago, Fetzie said:

Especially if you have not yet set up said vcs.

Nothing of value should be done without it, it's that simple.

1 hour ago, Fetzie said:

Also, I never fucking said that the OP should not use a vcs

No you didn't. What you did say however was:

21 hours ago, Fetzie said:

if you can't be bothered learning

Which is far worse since it suggests that it's alright to simply not bother doing things properly.

 

And then the obnoxious noises that you made:

1 hour ago, Fetzie said:

so you can cut the high and mighty attitude.

Only serve to further compound your complacency and ignorance on the subject.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Anyway, to get back to answers to @Saddy 's OP (who asked how they can maybe recover the lost data), this is a great piece of software: https://www.piriform.com/recuva

 

It has an option to install it on a USB stick to avoid writing to drive sectors that could contain files. The free edition can get pushy about upgrading to the paid version, but I have had great success recovering "lost" files with it in the past.

Intel i7 5820K (4.5 GHz) | MSI X99A MPower | 32 GB Kingston HyperX Fury 2666MHz | Asus RoG STRIX GTX 1080ti OC | Samsung 951 m.2 nVME 512GB | Crucial MX200 1000GB | Western Digital Caviar Black 2000GB | Noctua NH-D15 | Fractal Define R5 | Seasonic 860 Platinum | Logitech G910 | Sennheiser 599 | Blue Yeti | Logitech G502

 

Nikon D500 | Nikon 300mm f/4 PF  | Nikon 200-500 f/5.6 | Nikon 50mm f/1.8 | Tamron 70-210 f/4 VCII | Sigma 10-20 f/3.5 | Nikon 17-55 f/2.8 | Tamron 90mm F2.8 SP Di VC USD Macro | Neewer 750II

Link to comment
Share on other sites

Link to post
Share on other sites

I'm glad to see that an entire flame war as started on this forum. Anyway for a moderator to lock this? I do not wish to receive any more posts.

--------------------------------------------------------------------------------------

If this post solved your problem, please press the check below :).

--------------------------------------------------------------------------------------

Link to comment
Share on other sites

Link to post
Share on other sites

Also if any of you actually read my posts, you would see that I said that I was going to make a git backup that night. I knew that I needed to do it and I was going to, but it got corrupted before I could.

 

(I am looking at you @Cruorzy, as I thought I made myself clear that I knew about it and just didn't do it yet, and was asking if there was a way how to get it back. Thank you for your response though)

--------------------------------------------------------------------------------------

If this post solved your problem, please press the check below :).

--------------------------------------------------------------------------------------

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Saddy said:

Also if any of you actually read my posts, you would see that I said that I was going to make a git  backup that night.

Did you read your own posts?

On 15/08/2017 at 4:07 PM, Saddy said:

 I had no backup as I was going to configure that tonight

Because you certainly don't mention Git anywhere...

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

14 hours ago, Saddy said:

Also if any of you actually read my posts, you would see that I said that I was going to make a git backup that night. I knew that I needed to do it and I was going to, but it got corrupted before I could.

 

(I am looking at you @Cruorzy, as I thought I made myself clear that I knew about it and just didn't do it yet, and was asking if there was a way how to get it back. Thank you for your response though)

Just make sure you have your arguments right if you want to call me out for trying to inform you about something while you dont mention it, because you never mentioned git anywhere like @Nuluvius said. even after reading your 2 posts after it it wasnt clear for me that you were making a GIT backup.

 

Anyways i hope you got your code back or are on the right tracks again,since you are using git. Make regular pushes so it doesn't happen again ;)

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×