Category: Tech
-
Using HeidiSQL to connect to PostgreSQL through SSH tunnel
Was trying to connect to a PostgreSQL database running through VirtualBox locally, but is only exposed though SSH. In order to do that, I have to connect through an SSH tunnel. I found the following article here http://www.heidisql.com/forum.php?t=15472 that says: SSH tunnel is built into HeidiSQL for MySQL only. For using a tunnel to a PostgreSQL…
-
Days Until Christmas in PHP
Here’s how to calculate the days until Christmas using PHP: $daysuntilxmas = ceil((mktime(0,0,0,12,25,date(‘Y’)) – time()) / 86400); echo “There are $daysuntilxmas days to Xmas!”; You can combine this with my End of the day countdown javascript to have a realtime countdown with hours, minutes, and seconds. If you do that, decrement the $daysuntilxmas by 1…
-
Mobile Phone vs. Tablet Detection in PHP
Since posting Simple Mobile Browser Detection in PHP I have received feedback indicating that an iPad is not considered a mobile device. It ultimately depends on your definition of ‘mobile’, but I see their point in that tablets are very different from cell phones. Screen size and browser capability are pretty different between mobile phones and tablet/pads, so I…
-
Why your speed affects your MPG
I recently did a lot of research concerning the effects of your driving speed on your car’s fuel efficiency. I was very shocked by all the info and results I found. I was also shocked that there wasn’t 1 site that explained it all together. So, I created one: http://www.mpgforspeed.com/ The site gives you the…