Skip to content

Instantly share code, notes, and snippets.

<?php
/* Determining the domain - DO NOT EDIT */
$host = $HTTP_HOST;
$parts = explode('.',$host);
if ($parts[3] = "") {
$domain = $parts[0];
} else {
$domain = $parts[1];
@bMinaise
bMinaise / visible-script.js
Created October 15, 2013 01:00
Background Change - Visible Script
// jQuery isVisible script - bg color swap
var win = $(window);
var allMods = $(".featurette");
allMods.each(function(i, el) {
var el = $(el);
if (el.visible(false, true)) {
//el.addClass("colorize");
}
});
@bMinaise
bMinaise / wp-enqueue-scripts.php
Last active December 25, 2015 14:59
Load Scripts in Wordpress 'the WRITE way'
<?php
/*
* WordPress Sample function and action
* for loading scripts in themes
*/
add_action( 'wp_enqueue_scripts', 'wptuts_styles_with_the_lot' );
function wptuts_styles_with_the_lot()
@bMinaise
bMinaise / hide-modal-ajax.js
Created October 15, 2013 22:22
Hide Modal on Ajax Submit - Gravity Forms
// hide modal on ajax submit
$('#gform_id').on('submit', function(){
$.post("/#gf_id", $(this).serialize(), function(){
var delay = 6000;
setTimeout(function(){
$("#modalID").modal('hide');
//window.location.href = 'success.php';
@bMinaise
bMinaise / gf-hide-show.php
Created October 18, 2013 18:40
Hide field from logged in users Hide field from logged out users #repurpose for loading in titles headers through js http://code.johnpbloch.com/2011/11/gravity-forms-snippet/
<?php
/**
* Filter out the html for fields if they should be hidden from users logged in or out.
*/
function _avm_dym_gform_field_content( $content, $field, $value, $zero, $form_id ) {
if( is_admin() )
return $content;
if( !empty( $field['hideIfLoggedIn'] ) && is_user_logged_in() )
return '';
@bMinaise
bMinaise / gf-mpnav.php
Created October 18, 2013 19:03
Multi-Page Navigation Steps Gravity Forms https://gist.github.com/spivurno/
<?php
/**
* Multi-page Navigation
* http://gravitywiz.com/
*/
class GWMultipageNavigation {
private $script_displayed;
@bMinaise
bMinaise / text-rendering.css
Created October 22, 2013 00:49
CSS - Text Rendering Styles
body {
text-rendering: auto;
text-rendering: optimizeSpeed;
text-rendering: optimizeLegibility;
text-rendering: geometricPrecision;
}
@bMinaise
bMinaise / flying-focus.js
Created October 28, 2013 17:25
Focus Animation Transition Description: Animate keydown tab navigation - focus From http://n12v.com/focus-transition/flying-focus.js
(function() {
if (document.getElementById('flying-focus')) return;
var flyingFocus = document.createElement('flying-focus'); // use uniq element name to decrease the chances of a conflict with website styles
flyingFocus.id = 'flying-focus';
document.body.appendChild(flyingFocus);
var DURATION = 100;
flyingFocus.style.transitionDuration = flyingFocus.style.WebkitTransitionDuration = DURATION / 1000 + 's';
<?php
/* Add a custom field to the field editor (See editor screenshot) */
add_action("gform_field_standard_settings", "my_standard_settings", 10, 2);
function my_standard_settings($position, $form_id){
// Create settings on position 25 (right after Field Label)
if($position == 25){
?>
<!--
CSS STYLES:
body { padding-top:30px; }
.form-control { margin-bottom: 10px; }
-->
<!-- User Sign-up Form -->
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-4 well well-sm">