Skip to content

Instantly share code, notes, and snippets.

@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 / 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){
?>
<div class="container">
<div class="row-fluid">
<div class="span8">
<iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=15+Springfield+Way,+Hythe,+CT21+5SH&aq=t&sll=52.8382,-2.327815&sspn=8.047465,13.666992&ie=UTF8&hq=&hnear=15+Springfield+Way,+Hythe+CT21+5SH,+United+Kingdom&t=m&z=14&ll=51.077429,1.121722&output=embed"></iframe>
</div>
<div class="span4">
<h2>Snail mail</h2>
<address>
<strong>Hythe Window Cleaning</strong><br>
<div class="container">
<div class="row-fluid pricing-table pricing-three-column">
<div class="span4 plan">
<div class="plan-name-bronze">
<h2>Bronze</h2>
<span>$8.99 / Month</span>
</div>
<ul>
<li class="plan-feature">10 Users</li>
<li class="plan-feature">5TB Disk Space</li>
@bMinaise
bMinaise / thumbs.css
Created November 6, 2013 06:10
Bootstrap 3 - Thumbnail Caption Hover Snippet by: sevenx.de
body {
padding-top: 50px;
}
.thumbnail {
position:relative;
overflow:hidden;
}
.caption {