In this post I would like to present a few PHP functions which I created for projects I worked on and which I found very useful many times.
The functions are not super-advanced, but really handy. You can use them freely as they all are licensed under MIT.
I think there is a big chance you will find them useful too. If you do- please leave a comment, thanks!
Read full article
I always write my JavaScript scripts in Firefox, I test them in Firefox and then I move to Opera and Chrome/Safari. After my script works in all above browsers I try to make it work in IE at least version 8 (but sometimes also 7 and even 6).
Usually there are none to very little changes needed to port a script from Firefox to Opera & Chrome/Safari. Especially when I use jQuery library, but IE… that’s a different story.
Read full article
Lately I got this error in my script while trying to decode serialized UTF-8 string:
unserialize() [function.unserialize]: Error at offset 118 of 512
Here’s a simple solution I found.
Read full article
Want to make a nice gradient colored box without using ugly background images? Just apply this set of rules to any element, like DIV:
background-color: #00FF00;
background-image: -moz-linear-gradient(top, #00FF00, #FFFF00); /* Firefox */
background-image: -ms-linear-gradient(top, #00FF00, #FFFF00); /* IE10 */
background-image: -o-linear-gradient(top, #00FF00, #FFFF00); /* Opera */
background-image: -webkit-gradient(linear, left top, left bottom, from(#00FF00), to(#FFFF00)); /* Safari/Chrome */
background-image: -webkit-linear-gradient(top, [...]
Read full article
If you want to make a diagonal line in CSS you can just draw a rectangle with height so small it’s almost a line and then rotate it a bit.
Read full article
Magento shop is using PrototypeJS library which is registering $ for itself. jQuery library wants to do the same thing, that’s why in order to use jQuery in a website which uses PrototypeJS (or similar library) you need to put it into Compatibility Mode.
Read full article
Analyzing HTTP headers is a great way to debug websites. This is the easiest way to check what data was actually returned by Ajax request or find out if a website redirected us to another place. You can also check POST and GET fields sent by the browser and even modify then on the fly.
Read full article
Here’s a nice alternative to TypeKit. It’s free no matter how many visitor you have on your website, you can use an API or just download the fonts and use @font-face to embed them on your website. You can also download and install them in your OS and use in graphic editors to make nice headers or whatever you need!
Read full article
Why would one want to make a circle or elipsis in just pure CSS? Because you can easily change the color and size using CSS and it looks great even when upscaled!
And how to do it, well, it’s extremely simple- let’s create a small rectangle:
<div style=”width:70px; height:50px; background-color: red”></div>
and then let’s add rounded corners to [...]
Read full article
Recently I created a nice True Type font (.TTF) to embed on my website using CSS3 @font-face technique. Unfortunately it completely didn’t work- not in Firefox, not in Opera- just not at all. I replaced my font file with another one and it worked just fine in the web browsers. I installed my font in my OS and then I could use it with any application, like OpenOffice or Corel Draw.
Read full article