Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@thejwalker
thejwalker / HH:MM:SS
Created September 19, 2011 01:53
Convert Seconds to HH:MM:SS
function seconds($seconds) {
// CONVERT TO HH:MM:SS
$hours = floor($seconds/3600);
$remainder_1 = ($seconds % 3600);
$minutes = floor($remainder_1 / 60);
$seconds = ($remainder_1 % 60);
// PREP THE VALUES
if(strlen($hours) == 1) {
@thejwalker
thejwalker / Validate Email
Last active December 23, 2015 00:39 — forked from Sergic/email.php
filter_var($email, FILTER_VALIDATE_EMAIL);
@thejwalker
thejwalker / bootstrap-template.php
Created February 4, 2014 15:12
Basic Twitter Bootstrap Template
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
@thejwalker
thejwalker / Archive_Tar.php
Last active September 22, 2015 13:15
PEAR - PHP Archive_Tar
// REQUIRE THE PEAR PACKAGE - https://pear.php.net/package/Archive_Tar/
require_once 'Archive/Tar.php';
// SETUP THE ARCHIVE OUTPUT
$tar_object = new Archive_Tar($outpath, true);
$tar_object->setErrorHandling(PEAR_ERROR_PRINT);
// TAR $file
if($tar_object->create(array($file))) {
/* DO STUFF */