Answer by HoldOffHunger for wrong text encoding on linux
TLDR Quickest Solution: Copy/Paste the Visible Text to a Brand-New, Confirmed UTF-8 FileYour file is marked as latin1, but the data is stored as utf8.When you set set-enc=utf8 or set fileencoding=utf-8...
View ArticleAnswer by HoldOffHunger for Why can't I login to mysql with --login-path=local?
I had this problem, and thought I'd share my solution in my case:TLDR: Manually Connecting Works because the Default Host is Not Local, But You're Configuring MySQL_Config_Editor with LocalYour example...
View ArticleAnswer by HoldOffHunger for LinkedIn & Twitter, Share website image through URL
Twitter...https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}Source: Official Twitter Share URL...
View ArticleAnswer by HoldOffHunger for Paused in debugger in chrome?
The Chrome Debugger Pause Button -- international hide & seek champion!Here is what it looks like in 2022:
View ArticleAnswer by HoldOffHunger for Adding Line Numbers To HTML Textarea
TLDR: Use CodeMirrorSomeone else here recommended CodeMirror, and I can't hardly recommend it enough! But this answer didn't really provide any technical details.Other solutions: Everything else I...
View ArticleAnswer by HoldOffHunger for How do I get the current date and time in PHP?
Use date() and DateTimeInterface::format to format a date, i.e., date('Y-m-d H:i:s');, and you have these as your optional formatting:Source: DateTimeInterface:::format page.format...
View ArticleAnswer by HoldOffHunger for How to do fade-in and fade-out with JavaScript...
My answer is based on Gb01's answer (thank you!). I wanted to abstract out the logic so that we could simply pass an element to a function and have that element fade toggle, fade in, or fade out.PODTo...
View ArticleAnswer by HoldOffHunger for How to position text over an image with CSS
Quick solution: Set position: relative; on the container element and set position: absolute; on child elements in that container element, with the necessary top, left, bottom, right-adjusting...
View ArticleAnswer by HoldOffHunger for javascript - innerHTML with fade in
Try not to worry about fading in/out the innerHTML property. Instead, wrap the innerHTML in a span tag (or, alternatively, a div tag), and then simply fade that element in and out.Here it is with a...
View ArticleAnswer by HoldOffHunger for Javascript alert message Alternative
This can be done relatively easy, without too much code, and with the feature of fading in/out. The below example fades in and out at a rate of 3 seconds per fade, but this can be changed by modifying...
View ArticleAnswer by HoldOffHunger for Javascript shake html element
It's possible to have the animation done entirely with very simple CSS and JS. The strategy involves two things:transition: all 500ms;— This bit of CSS means that anytime we want to do a transition...
View ArticleAnswer by HoldOffHunger for URL encode sees “&” (ampersand) as “&” HTML...
Just to be clear, you should never be using encodeURI() and encodeURIComponent(). If you disagree, just look at its results...console.log(encodeURIComponent('@#$%^&*'));Input: ^&*.Output:...
View ArticleAnswer by HoldOffHunger for How to create a gravity effect with Javascript?
One other framework to consider: Matter.js —Demo: Easy Physics Sandbox in JavaScript.The PhysicsGravity is hard. That's because gravity is curved spacetime, and we can only make 2d representations of...
View ArticleAnswer by HoldOffHunger for Calling a JavaScript function in another js file
TLDR: Load Global Function Files first, Then Load Event HandlersWhenever you are accessing an element within a JS file or <script> block, it is essential to check to make sure that element...
View ArticleAnswer by HoldOffHunger for Responsive Web Design Tips, Best Practices and...
The answer by Steven de Salas is excellent! If you have the time, effort, and/or team available to do a hand-crafted mobile website, then go for it with his tips.But if you want just an automated,...
View ArticleAnswer by HoldOffHunger for send whatsapp message using php
The official documentation says to use their wa.me URL, so let's just check it out: http://wa.me/?text=mytest. What do you see? Do you see an error page? This is what I see:We couldn't find the page...
View ArticleAnswer by HoldOffHunger for Share website URL with image and description...
LinkedIn only supports one URL format...https://www.linkedin.com/sharing/share-offsite/?url={url}Source: Official LinkedIn Sharing Documentation.But if you want to populate things like title and image...
View ArticleAnswer by HoldOffHunger for MySQL: Setting sql_mode permanently
If you are using Digital Ocean, the mysql cnf files are emulated and don't actually really interact with the database. In this case, you set your sql-mode with (for a blank sql mode)...doctl databases...
View ArticleAnswer by HoldOffHunger for How to set onClick with JavaScript?
If you have a named function, i.e., function funcName() {...} already defined, then the process is simply to identify onclick with the name of the function:document.getElementById("myBtn").onclick =...
View ArticleAnswer by HoldOffHunger for PHP script to loop through all of the files in a...
There is a problem with using the accepted answer's suggestion of DirectoryIterator. After all, just load up the documentation page for the iterator and see if you can find any problems -- in fact,...
View Article