There are times when it’s really useful for a webpage to scroll up and down automatically. For instance when showing information on a TV screen you may not want to scroll manually. Using jQuery its possible to have the page automatically scroll down at a set speed then scroll back to the top and repeat.Continue Reading
Gitlab is a great alternative to Github or BitBucket, they offer free private and public repositories which is great when working with a team, I’ve recently started using Gitlab for a private project, where I need to download private repositories to the project server and extract their contents.Continue Reading
I have a folder of csv files that need uploading to a server I don’t want to do it manually, Bash can handle this task perfectly.
This script will connect to an FTP server then loop through the csv files or any type specified and upload them. You cannot do a loop whilst inside of heredoc block like most examples do, instead the commands are written to a txt file.Continue Reading
Sometimes you need to make improvements to your code and make things more efficient. Using some simple PHP Statistics can help you identify areas which need improving. These snippets offer useful insight into how efficiently your application is running.
So, for our first snippet we will look at script execution time. This will tell us how long it took the server to process and execute our PHP script. This is one of the most useful snippets. It would also be very useful for benchmarking PHP 5.6 versus 7.0.Continue Reading
HTML 5 has some great API’s one of which is the notifications api which lets you set browser notifications to the end user, outside of the website scope so they can be issued when the user switches to another tab or application.Continue Reading
When working with forms there are often times it would be really handy to be able to submit the form and depending on the button clicked changed the form action the data is posted to. Normally this has not been possible so we find workarounds.
I recently found the need for this again and come across a HTML attribute called formaction which is amazing for this! This attribute allows you to specify the url to post to which when pressed will override the form action attribute.Continue Reading
I’ve noticed recently when using MAMP to test PHP 7 that changes are not shown right away when looking at the browser. Sometimes it can be a few seconds before the changes are updated. That can be misleading if you don’t reliase it’s cached.
Turns out from PHP 5.5 opcache is turned on my defaultContinue Reading