CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Recent Posts

Pages: [1] 2 3 ... 10
1
JavaScript / Re: Optimization
« Last post by Jason Knight on 13 Sep 2021, 01:37:27 pm »
Combining down files when possible -- be it CSS, JS, or even presentational images (see the incorrectly named "CSS Sprites") -- has a lot of advantages.

1) less handshaking. The raw number of separate files increased load time because each request ends up a connection.

2) Better caching. for a small penalty on the first cache empty page load, you can pre-cache what's used on other pages even if it's not used on the current one. If you have sites where users are visiting lots of different pages, anything you can move out of the HTML can result in faster load times AFTER the first page.

This is something a lot of garbage "JS For Nothing" -- such as "Single Page Applications" -- oft tries to "fix" in situations where the dev isn't qualified to write HTML. Because of course throwing more code at things will make it faster -- NOT!

3) Better compression. "gzip" compression of files is more efficient the more often the same run of characters is repeated. As a single file the odds of repetition of words like "function" or "typeof" or any other word/run of characters increases. Compression also tends to include a lookup table / dictionary of said words/phrases that are replaced in the data stream. Having a single file increases the odds of "hits' resulting in smaller files.

That said, there ARE scenarios where you will have so much JS and so many files you get diminishing returns on that, but 99% of the time that just means the code in question is shite. See where people crap out megabytes of JavaScript to do two or three dozen kilobyte's job, or worse where a page doesn't even NEED JavaScript. See the time-wasting energy-exhausting code-bloat mental-huffing-midgetry known as "frameworks"

When it comes to the Google Tag Manager, my opinion is that steaming dung heap should be ripped out of every site it's used on. Between the mix of creep level spyware, page load delays, and general micromanagement of pointless data points that wastes time that could and would be better spent GENERATING CONTENT OF VALUE, it serves no purpose other than providing pointless data-points for marketing turds to circle-jerk each-other over. GET RID OF IT! It's doing you zero favors.

As to "defer", it can be useful if you want to skip hooking DOMDocumentReady but you need to be aware that when the script actually loads and executes is a bit willy-nilly. To me it's a bit pointless since server-side you likely just want the script to load and run NOW, and client-side if it makes a difference you've likely got too much scripting or worse, are inducing FOUC instead of preventing it.

It's useful, but I'm not a fan. If you can't just move all your scripts to before </body>, you've got bigger problems than adding an attribute to the language is going to fix.
2
JavaScript / Optimization
« Last post by AndrewTraub on 10 Sep 2021, 04:07:40 pm »
1) Is it best to combine all javascript files a site will use into one file, even if not every page will use them?
2) Is it possible to have the google tag manager all other scripts it loads deferred or output before the end of the body tag?
3) Is adding "defer" to a script in the header as good as putting the script before the end of the body tag?

Thanks,

Andrew
3
General Discussion / Re: /for_others download snapshots
« Last post by John_Betong on 6 Sep 2021, 12:22:59 am »
It makes no sense to raise issues for old code that is not intended to be updated since it's an archive.

Focusing on the topic, even if the code is old it's *very* helpful since it gives clues on how to structure parts of websites. Thank you Jason.

I far prefer code that is working especially when trying new scripts.

Why should archived fail to work and necessitate Debugging strange code. I think it is preferable to have a GiHub Repository to allow for users to raise issues. As an example when PHP is upgraded to a newer version, some scripts may need adjustments.

And don't forget...

There's an App for that :)
4
General Discussion / Re: /for_others download snapshots
« Last post by fgm on 5 Sep 2021, 08:12:08 am »
It makes no sense to raise issues for old code that is not intended to be updated since it's an archive.

Focusing on the topic, even if the code is old it's *very* helpful since it gives clues on how to structure parts of websites. Thank you Jason.
5
JavaScript / Re: Elementals 4
« Last post by JS Kelly on 3 Sep 2021, 03:05:00 pm »
what's really holding it up is creation of a new website with all-new documentation...

I would like to offer my editing services with regard to the creation of the 'new website and all-new documentation.' And my editing services in general -- I'd be happy to proofread any of your Medium articles before they are posted [in "Convincing People That Web Accessibility Matters," my two main comments would be that you often put punctuation outside quotation marks (“too expensive to waste money on for so few people”, should be  “too expensive to waste money on for so few people,”) and then also you use the word "gypped" which some people consider to be racist]. I also have a bunch of story ideas for you, if you are interested. Lately I spent a few days reading about these new-fangled "static site generators" and the whole time I was reading about them, I kept thinking "I wish Deathshadow had a rant about this!" No matter where I go and what I read, I always come back here to ccd to recharge my sanity in all things webby. This is by far my favorite site for html/css, and I thank you again for keeping it going.

In other news, my own little project is slooooowly progressing. One day soon I hope to have some html/css to post here for help.

Finally, in the paragraph below the one I quoted above, you use "worry-wart" -- it should be 'worrywort.'

Happy weekend everyone
--jsk

PS Deathshadow -- if you /are/ interested in editing help, you have my email address.
6
JavaScript / Re: Elementals 4
« Last post by makotoshishio on 2 Sep 2021, 11:53:15 am »
Hoy hoy!

Hope all is well!

Just touching base to see how this is progressing?
7
General Discussion / Re: /for_others download snapshots
« Last post by John_Betong on 2 Sep 2021, 02:21:19 am »
@Jason Knight,
I'm curious to know about "violating the rules".

I appreciate about most of the scripts are "archives" but must say that some problems may occur when software or security updates are activated. Github "Issues" could then be raised and the "archives" updated - and the Zip file automatically updates.

It is a pity that the updates to https://cutcodedown.com/for_others/squire3/ were becoming cumbersome and the following thread is an interesting discussion why the project was discontinued:

https://forums.cutcodedown.com/index.php?topic=399.msg2133#msg2133

Can you explain why Microsoft decided to acquire Github for  $7.5 billion in stock?

https://news.microsoft.com/announcement/microsoft-acquires-github/

I will reiterate and say that Github is well worth taking the time to learn even just the basics and convinced some of the "archives" would benefit instead of sticking rigidly to outdated practices.


Edit showing the power of GitHub:
I follow the GitHub CodeIgniter4 Repository which started about three years ago and has dozens of daily issues which are managed by the following Admins:

https://github.com/codeigniter4/CodeIgniter4/graphs/contributors
8
General Discussion / Re: /for_others download snapshots
« Last post by Jason Knight on 30 Aug 2021, 11:25:52 am »
Warning, I'm about to violate my own forum rules, but screw it I'm DONE when it comes to Git.

Thing is /for_others/ not really meant as a place to copy old code from. Half that stuff's a decade old or older now... Most if not all of the contents there are directly tied to specific posts on various forums, or articles. As such there is NO reason for "realtime updating' or "commits" or any of the rest of that pointless time wasting overhead. THERE ARE NO UPDATES! Nothing would "change" as it's old examples.

I'd say over two-thirds that is stuff you shouldn't be "downloading" in the first place, and if it is I put a .zip file in there. I certainly find it easier to browse the code where it is now than the utter dumpster fire that is shithub... where 99% of the time I can't even find where/when people make updates anyways!

Browse in place, learn from it if you can/must, but it's not exactly what I'd call the most up to date of sources and NO, nothing there is EVER to be updated really. It's an archive. That's the FREAKING POINT OF AN ARCHIVE!!!. Do you magically expect the "wayback machine" on "Internet Archive" to update old pages? DAFUQ?!?

This is why I utterly fail to see what the devil you folks think that shit or shithub would provide for benefits... BEFORE I talk about the shit-show that idiocy is.

EVERY F***ING TIME Git gets involved in anything I've ever worked on, it's cocked the entire damned process sideways and blown endless time on its dipshit rubbish.

Something I had mess me up for a week with someone earlier this month as they made a "feedback" fork and I was still looking at "master" wondering where the **** the update was. I just kept asking "could you just send me a .zip of your updated copy" because I couldn't find it!

F*** git, F*** shitub. And if you have a problem with that, F*** you too! Take that steaming dung-heap, dump a can of shellac on it, shine it up real nice, turn it sideways, and stick it straight up your candied asses.

I have no use for it, AND IT IS NOT WELCOME IN ANYTHING I DO!

Especially with the number of know-nothing numbnuts out there who seem to use it just to turn a 10k project that shouldn't be more than five files in one directory into a 200k train wreck of 200 files in 10 directories!
9
General Discussion / Re: /for_others download snapshots
« Last post by fgm on 30 Aug 2021, 10:23:51 am »
I'd just setup a crontab to run a script that periodically takes a snapshot of the full directory into a zip file and deletes the previous one. It would be way easier than having to mess with git and github.
10
General Discussion / Re: /for_others download snapshots
« Last post by John_Betong on 26 Aug 2021, 10:00:25 pm »
I agree that the /for_others/ information is very good and it is a shame that Jason prefers to "do it his way" and not follow tried and tested alternatives such as GitHub Repositories. They are free and once a Repository has been created the following commands will upload all files in seconds. The public files can then be downloaded using a single SSH Commamd URL or a ZIP file which requires more keystrokes :(

Code: [Select]
git add .
git commit -m "optional message"
git push

There are graphical interfaces available for Windows and Mac users which I believe are user friendly.

Online Forums relating to programming scripts are now "old hat" and perhaps Jason is afraid of the ease that GitHub users are able create "Issues"?

Reminds me of old dogs and new tricks :)
Pages: [1] 2 3 ... 10
SMF spam blocked by CleanTalk

Advertisement