Skip to content

Instantly share code, notes, and snippets.

CJ cjwebdev

Block or report user

Report or block cjwebdev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View click-off.js
$('.overlay').on('click', function(event) {
if (!$(event.target).closest('.exit-popup').length) {
signup.closeSignup();
}
});
View gist:17b09bcb159ed750d97a9c06f5a76190
//http://pl.php.net/manual/en/function.date.php
date("jS F, Y", strtotime($course['Start_Date__c']))
View gist:052efd0a299879da50fd7f1e25ac6a34
<?php
$start_dir = '/home/hiscoes/public_html/wp-content/plugins'; // Starting directory name no trailing slashes.
$perms['file'] = 0644; // chmod value for files don't enclose value in quotes.
$perms['folder'] = 0755; // chmod value for folders don't enclose value in quotes.
function chmod_file_folder($dir) {
global $perms;
$dh=@opendir($dir);
View gist:fcacde492e8fec1903ebd7b0c9e32e6c
//Basic form validation
$('form[novalidate]').on('submit', function(event){
$('.form-control', this).each(function(){
if (this.checkValidity() == false || ($(this).attr('data-match') && $(this).val() != $('#' + $(this).attr('data-match')).val())) {
event.preventDefault();
event.stopPropagation();
$(this).parents('.form-group').addClass('has-error');
}
else {
$(this).parents('.form-group').removeClass('has-error');
View gist:3c787120368f362e26c97ae9943dd9ce
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
//getParameterByName('var')
}
View gist:63f7386cd7c030c7fa19ba61f21be844
<html>
<head>
<style>
div input[type=radio]{
position: absolute;
visibility: hidden;
}
View Vertical align anything
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@cjwebdev
cjwebdev / gist:a68b060039bc22016d01
Created Jan 6, 2015
Video: Embed YouTube with external controls
View gist:a68b060039bc22016d01
<iframe id="video" src="//www.youtube.com/embed/FKWwdQu6_ok?showinfo=0&amp;rel=0&amp;wmode=opaque&amp;autohide=1&amp;autoplay=1&amp;enablejsapi=1&amp;html5=1" frameborder="0" allowfullscreen></iframe>
<script>
// http://css-tricks.com/play-button-youtube-and-vimeo-api/
// https://developers.google.com/youtube/iframe_api_reference
// global variable for the player
@cjwebdev
cjwebdev / gist:3fe63af07f1910a5836f
Last active Jun 18, 2018
jQuery: Equal Column Heights Plugin
View gist:3fe63af07f1910a5836f
/*
* EqCol - Equalise Grid column heights
* Requires "Responsive Page Modes Plugin"
* http://cjweb.com.au
* Version: 1.0.0 (11-NOVEMBER-2014)
* Dual licensed under the MIT and GPL licenses.
*
* USAGE INSTRUCTIONS
* $('.grid').eqCol(); // <ul class="grid" data-eqcol-mode="medium,large" data-eqcol-item=".grid-col" >
*
@cjwebdev
cjwebdev / gist:8bfe85d27cde51eaa538
Last active Oct 24, 2018
jQuery: Responsive Breakpoint Plugin
View gist:8bfe85d27cde51eaa538
/*
* Responsive Page Modes Plugin - Responsive page modes based on window width
* http://cjweb.com.au
* Version: 1.0.0 (11-NOVEMBER-2014)
* Dual licensed under the MIT and GPL licenses.
*
* USAGE INSTRUCTIONS
*
* Load with:
*
You can’t perform that action at this time.