Spark Media
Interesting online projects and passions.
Design, coding, video production, we do it all.
  • [PhpMyAdmin] Incorrect Format Parameter (Database Import Issue)

    Incorrect format parameter is a problem I ran into while trying to import my database that I exported from my other server. The solution: upload_max_filesize=64M post_max_size=64M max_execution_time=1000 I had to also change this:

    11 months ago Read More
  • [CentOS] How To Check Current Version Of Apache

    My efforts of trying to get HTTP/2 set up continue. I need to figure out what version of Apache I have, so here's the terminal code I found for that. # httpd -v After inputting that, I find that my current version is 2.4.6. The Apache website says that the most current version is 2.4.43, which see...

    11 months ago Read More
  • [Terminal] How To Fix Warning About ECDSA Host Key

    I came across this issue when I was switching around the IP address of this website (sethciasulli.com) and accessing it via terminal on two different servers. When I switched the IP address and then tried to access the newly assigned server I get this error, warning me that the ECDSA Host Key has ch...

    11 months ago Read More
  • [CentOS 8] How To Set Up New Server From A Blank Slate

    Taking notes so I don't forget this process again. This is what I do when I create a new server from scratch. //-> install, start, enable httpd, php, mysql, vsftpd yum update //-> installs Apache, which is needed for websites to run (I think) yum install httpd systemctl start httpd syste...

    11 months ago Read More
  • How I Improved First Contentful Paint And First Meaningful Paint

    I'll detail my thoughts on this issue more in the future, but basically the goal is to delay the loading of render blocking elements that aren't essential for the website for as long as possible. In my case this means, loading in jQuery, jQueryUi, and Javascript in general after the page itself has ...

    12 months ago Read More
  • Find The Last Item In A Foreach

    I've always tried to find ways to do pagination or correctly display lists. So, given that I use Yii to code in PHP, I'll get an array using $table = Table::model()->findAll("status='0'"); but never realized that you can use count(); to count how many rows came back. So here would be a solution to p...

    2 years ago Read More
  • What's The Ucwords() Equivalent In Javascript? Capitalize Each Word In A String

    I am wondering why Javascript doesn't have more functions like PHP has. I use the ucwords(); function with PHP when I have to, it capitalizes each word of the string. There is no real equivalent to that in Javascript though, so we have to do a workaround. I suppose there's a lot of ways to do this, ...

    2 years ago Read More
  • How To Delay Image Loading Until It's In View

    So I had another idea with the image loading. This time, I wanted to make it so images don't load unless they are in view. This should help out page times a little bit and make a nice little fade in effect whenever you see new images. This also allows me to animate them in interesting ways on load. ...

    2 years ago Read More
  • How To Change The Color Of Ordered List Items

    Today I came across the idea of reshaping my code div inside these posts. I wanted it to be a dark theme, because I rather prefer dark theme while writing in code. So I made the background dark, color of the font white, even added a separate color for any comments that I'll put after lines to explai...

    2 years ago Read More
  • Using JQuery & The CSS Transition Property To Create Interesting Transitions

    I had the idea today of making the top of the website, the header images, transition more fluidly. I don't like how they fade in so abruptly, even though that's a good solution for them to just pop in. I used to use jQuery's $().animate({ }); to animate things like opacity and whatnot. In order to a...

    2 years ago Read More
  • Text Area With 100% Width With Borders And Padding

    This was something that I just recently figured out. For years my CSS was this: <textarea></textarea> <style> textarea{ border: 1px solid #000; padding: 5px; /* border-left (1) + border-right (1) + padding-left (5) + padding-right (5) = 12 */ width: calc(100% - 12px); } </...

    2 years ago Read More
  • How To Auto-Grow A Text Area

    Today I was messing around with my admin side of things and I discovered that my textareas were not behaving the way I wanted them to. I want them to grow when you type into them. I had this complicated code written out to accomplish this, but I thought, "there's gotta be a better way." So here's my...

    2 years ago Read More
  • How Do You Display HTML Tags?

    To display HTML tags in a website, use their HTML encoding translation. Replace the < character with &lt; Replace the > character with &gt; Replace the & character with &amp; You don't actually have to encode the ">" character. That one will show as long as you encode th...

    2 years ago Read More
  • Where Does The List-style Property Actually Matter?

    By editing the list-style property of the Li the element, you will be able to change the list-style property. It seems that the default list-style property in an LI is "inherit", but if you change it at the top of your CSS style sheet then it will be stuck as that everywhere. So editing it on your U...

    2 years ago Read More
  • Using JQuery To See If An Element Exists

    To see if an element exists, the easiest way is to count how many elements of that type are on the page. Use the .length property of the jQuery collection returned by your selector: <div></div> <script> if($('div').length){ //-> if div has a length, ie: has more than zero instances...

    2 years ago Read More