Skip to content

Instantly share code, notes, and snippets.

View jackabox's full-sized avatar
🛠️
Available for Hire

Jack Whiting jackabox

🛠️
Available for Hire
View GitHub Profile
@jackabox
jackabox / modal.html
Last active December 14, 2015 01:49
Creating a JS function to fire a reveal model on a link.
<div id="arbitrary-modal" class="reveal-modal medium">
<div class="modal-content"></div>
<a class="close-reveal-modal">&#215;</a>
</div>
@jackabox
jackabox / custom.js
Created March 26, 2013 21:00 — forked from drewjoh/custom.js
Bootstap Load Ajax data into Modal Window
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {
@jackabox
jackabox / header.php
Last active December 19, 2015 10:19
Using jQuery to Toggle a Search Box
<div id="sarea">
<form id="searchform" action="<php echo home_url( '/' ); >" method="get" role="search">
<input id="s" type="text" name="s" value="" placeholder="Search Here & Hit Enter">
</form>
</div>
<a href="#" id="sbutton"> Search </a>
@jackabox
jackabox / footer.php
Created July 6, 2013 11:18
Fadein Anchor Button with jQuery
@jackabox
jackabox / index.html
Created November 12, 2013 11:48
Standard HTML Page Template
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="en" />
<meta name="description" content="__description__" />
<meta name="keywords" content="__keywords__" />
<meta name="author" content="Jackabox" />
@jackabox
jackabox / contactForm.php
Last active July 8, 2021 15:52
A Standard PHP contact form with validation of required fields
<?php if(isset($_POST['cf_submit'])) {
$errors = array();
$success = null;
$required_fields['cf_name'] = 'You are required to enter your Name.';
$required_fields['cf_email'] = 'You are required to enter your E-mail Address.';
$required_fields['cf_subject'] = 'You are required to enter a Subject.';
$required_fields['cf_message'] = 'You are required to enter a Message.';
foreach($_POST as $key => $value) {
@jackabox
jackabox / helvetica.sass
Created November 18, 2013 14:37
Better Helvetica
body
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif
font-weight: 300
@jackabox
jackabox / modal.sass
Created November 28, 2013 14:50
Using an Ajax Modal to fire from a href
.modal
display: none
width: 600px
background: #fff
padding: 15px 30px
border-radius: 8px
box-shadow: 0 0 10px #000
margin-right: -300px
right: 50%
a.close-modal
@jackabox
jackabox / L4fileupload.php
Created December 7, 2013 16:02
File upload in L4
$rules = array(
'image' => 'image|mimes:jpg,jpeg,png|max:3000',
);
$validation = Validator::make($input, $rules);
if ($validation->fails()) {
return Response::make($validation->errors->first(), 400);
}
@jackabox
jackabox / ageCalculator.php
Created December 10, 2013 18:40
Working out the age from a DOB
<?php
//date in mm/dd/yyyy format; or it can be in other formats as well
$birthDate = '11/05/1992';
//explode the date to get month, day and year
$birthDate = explode("/", $birthDate);
//get age from date or birthdate
$age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md") ? ((date("Y")-$birthDate[2])-1):(date("Y")-$birthDate[2]));