Skip to content

Instantly share code, notes, and snippets.

View jim-at-jibba's full-sized avatar
🦄

James G. Best jim-at-jibba

🦄
View GitHub Profile
/*******************************************************************************
1. DEPENDENCIES
*******************************************************************************/
var gulp = require('gulp'); // gulp core
sass = require('gulp-sass'), // sass compiler
uglify = require('gulp-uglify'), // uglifies the js
jshint = require('gulp-jshint'), // check if js is ok
rename = require("gulp-rename"); // rename files
concat = require('gulp-concat'), // concatinate js
@jim-at-jibba
jim-at-jibba / country-list
Created August 5, 2014 02:17
Complete list of countries
<label for="country">Country <span class="brightRedText">*</span>
<select name="countries" id="country" required>
<!-- START: countries list -->
<option value="Thailand" selected>Thailand</option>
<option value="Singapore">Singapore</option>
<option value="Hong Kong">Hong Kong</option>
<option value="Malaysia">Malaysia</option>
<option value="China">China</option>
<option value="Taiwan">Taiwan</option>
<option value="India">India</option>
@jim-at-jibba
jim-at-jibba / Speech Bubble
Created August 5, 2014 02:18
Speech Bubble
.speechBubble:after {
content: "";
position: absolute;
top: 100%;
left: 40px;
border-top: 20px solid $midGrey;
// border-top-color: inherit;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
}
@jim-at-jibba
jim-at-jibba / disable dropdown parent
Created August 5, 2014 02:19
Disable Dropdown parent
var $j = jQuery.noConflict();
$j(document).ready(function () {
$j("li:has(ul)").hover(function () {
$j(this).children("a").click(function () {
return false;
});
});
@jim-at-jibba
jim-at-jibba / Centering Font Awsome Font
Created August 5, 2014 02:20
Centering Font Awsome Font
.whereEverYouWantIcon{
display:inline-block;
line-height: 50px;
background-color:black;
color:white;
width: 50px;
height: 50px;
text-align: center;
vertical-align: bottom;
}
@jim-at-jibba
jim-at-jibba / Form processing - swiftmailer
Last active August 29, 2015 14:04
Parts for form using swiftmailer - needs swiftmailer library
<!-- START form part -->
<?php
start_session();
//init variables
$cf = array();
$sr = FALSE;
if (isset($_SESSION['cf_returndata'])) {
<div class="home-slide flexslider">
<?php if(get_field('home_slide_repeater')): ?>
<ul>
<?php while(has_sub_field('home_slide_repeater')): ?>
<li>
<?php $image = wp_get_attachment_image_src(get_sub_field('home_slide_image'), 'home-slide'); ?>
@jim-at-jibba
jim-at-jibba / GA with demographic
Created August 18, 2014 08:25
GA tag with demographic
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-########-#', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
@jim-at-jibba
jim-at-jibba / Foundation no cnflict mode
Created August 20, 2014 05:06
Foundation no conflict mode
<script>
jQuery.noConflict();
jQuery(document).foundation();
</script>
@jim-at-jibba
jim-at-jibba / Simple Gulp Starter
Created September 5, 2014 12:14
Simple Gulp Starter
//Load plugins
var gulp = require('gulp'),
gutil= require('gulp-util') ,
sass = require('gulp-ruby-sass'),
prefixer = require('gulp-autoprefixer'),
notify = require('gulp-notify');
// Where do you store your Sass files?
var sassDir = 'scss';