Sometimes you need to calculate the price of a product excluding VAT, and the only details you have is the amount including vat and the vat percent. This might be a bit tricky in some applications when there are mixed VAT percentages. For example, you payed 1000 space credits and in that sum there is… Read More »
A simple JS function to validate that a date string in the format YYYY-MM-DD is a valid date. Will validate that the day is correct for the given month, including leap years
Here’s a hack for using the includes method also in the horrible Internet Explorer.
Replaces newline characters with <br> tags in the same style as the php nl2br function
Here’s how you can make a super simple slideshow that changes slides on a timer interval. You could easily edit it so any other event, like a mouse click, will trigger the slide() function. You can see it in action HERE HTML CSS jQuery And of course you could make this dynamic by spitting out… Read More »
Put this in app/start/global.php to get Laravels execution time to the browser console log. L4 This works with L5:
Converting seconds into days, hours, minutes and seconds int days = secondsTotal / 60 / 60 / 24; int hours = (secondsTotal / 60 / 60) % 24; int minutes = (secondsTotal / 60) % 60; int seconds = secondsTotal % 60;