Skip to content

Instantly share code, notes, and snippets.

Jon Walker thejwalker

View GitHub Profile
@thejwalker
thejwalker / Archive_Tar.php
Last active Sep 22, 2015
PEAR - PHP Archive_Tar
View Archive_Tar.php
// 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 */
@thejwalker
thejwalker / bootstrap-template.php
Created Feb 4, 2014
Basic Twitter Bootstrap Template
View bootstrap-template.php
<!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">
View Validate Email
filter_var($email, FILTER_VALIDATE_EMAIL);
@thejwalker
thejwalker / HH:MM:SS
Created Sep 19, 2011
Convert Seconds to HH:MM:SS
View 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) {
You can’t perform that action at this time.