Skip to content

Instantly share code, notes, and snippets.

View thebigtine's full-sized avatar
🏠
Working from home

Joseph VanTine thebigtine

🏠
Working from home
View GitHub Profile
<?php
function adding_products() {
// API call
$feed = new Boats_API_Client( 'yachtall', 'en', array( 'code' => 'xxx', 'site_id' => 'xxx', 'bt_vers' => '3.0', 'api_vers' => '1.0' ) );
echo '<pre>';
var_dump($feed);
echo '</pre>';
var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('sass', function () {
return gulp.src('style.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(''));
});
function lockBody(){
$body.css('overflow', 'hidden');
}
function unlockBody(){
$body.css('overflow', 'scroll');
}
<?php $temp_query = $wp_query;
$args = array(
'post_type' => 'region'
);
query_posts($args);
if (have_posts()) { ?>
<form>
<select id="event-region-select" autocomplete="off" onchange='doSubmit();'>
<option disabled selected>Select a region</option>
<option value="northland">Northland</option>
<option value="north-shore-auckland">North Shore - Auckland</option>
<option value="auckland">Auckland</option>
<option value="waikato">Waikato</option>
<option value="bay-of-plenty">Bay of Plenty</option>
<option value="hawkes-bay">Hawkes Bay</option>
<option value="wellington">Wellington</option>
<option value="christchurch">Christchurch</option>
<option value="queenstown">Queenstown</option>
<div class="image">
<!--<img src="images/map.png" alt="" />-->
<style>
#map {
height: 100%;
width: 100%;
}
@media (max-width: 767px) {
#map,
<?
function tf_cleanup() {
// EditURI link
remove_action( 'wp_head', 'rsd_link' );
// windows live writer
remove_action( 'wp_head', 'wlwmanifest_link' );
// previous link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
// start link
@thebigtine
thebigtine / centerVertical.js
Last active February 6, 2017 17:45
A script that centers a element inside its parent
function centerVertical(child, parent, property) {
var parentHeight = parent.height(),
childHeight = child.height();
// Position the child with an inline style
child.css(property, (parentHeight - childHeight) / 2);
} centerVertical($('.js-vertical-align-child'), $('.js-vertical-align-parent'), 'margin-top');
jQuery(document).ready(function($) {
let selector = $( '.selector' )
// Get an array of all element heights
var elementHeights = selector.map( function() {
return $( this ).height();
}).get()
// Math.max takes a variable number of arguments
.home .the-smart-way {
color: #fff;
background: #f7931e;
font-weight: bold;
height: 100px;
margin: 40px 0;
padding: 15px;
position: relative;
text-align: center;
}