Hey everyone I’m working on a new web design and I can’t remember the specific HTML code I used for a similar project I did before. It was a simple navigation menu, but I just can’t seem to find it in my files. Is there a trick to recovering old code snippets or ways to keep track of these things for future reference? Thanks for any help!
Your question is a little strange. First, if you can remember some text that was certainly in the file you are looking for, you can try searching by file content. If you use a unix-like system grep "guaranteed text here" / -r Code (markup): Hmm... I would not call the suggestion below a trick, but you generally need a better File/Folder management system. ie... Categorize similar files into the same folder and give your files proper names. For Example: • All Web Projects go in a "Web" Folder • Music in a "Music" Folder • Photos in a "Photos" Folder ...and so on Some File/Folder Management Tips • Give your files relevant names • Avoid saving multiple copies of the same file • Avoid creating too many irrelevant sub-folders • Create a file naming convention and stick to it. • ALWAYS have a Backup. Preferably 1 in a different Drive and the other on a cloud service • Do not ever distribute your files across Multiple Cloud services and so on... Now as a Programmer ALWAYS! ALWAYS!! use a Version Control System (VCS) like GIT. Use it even if you are the only developer working on a project.
I’ll definitely try searching by file content and start using a better file management system. I’ll also look into Git for version control. Seems like a great way to avoid this issue in the future. And no, I didn’t have it on GitHub or the Wayback Machine but I’ll keep that in mind for future projects. thanks for the help!
do you have any specific tools or methods you’d recommend for setting up a file naming convention or folder structure that works well for web development projects?
One trick I’ve found helpful is using a code snippet manager or even a simple text file to keep all my frequently used code handy. Also, don't forget to check your browser's developer tools, they sometimes save snippets from past projects.
Most sample projects I've seen have this structure Project - contains all the management style files like composor.json and .gitignore and a folder called "App" App - all the files that will be part of the new site and typically these folders - index.* and any files that will be called by users. assets - images, css, and any external scripts, downloadable files etc js - your own javascript files models, views - the php (what I tend to work in) files that won't be accessed by the user but will be called by other scripts. subfolders that will make up part of urls - unless you're using .htaccess to spoof those folders.
I try to use similar approaches across projects so I can remember my flow. I tend to lean on bootstraps navigation features. If you end up starting over from scratch should try using bootstrap, they are pretty consistent between versions.