Skip to content

Instantly share code, notes, and snippets.

@i556
i556 / gist:1661623
Created January 23, 2012 08:10
Cross Domain iframe Resizing
http://mohumohu/parent.html
http://hogehoge.com/iframe.html
//parent.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
@ronanguilloux
ronanguilloux / gist:5317541
Last active February 21, 2018 19:07 — forked from i556/gist:1661623
//parent.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script type="text/javascript">
window.addEventListener("message", receiveSize, false);
function receiveSize(e) {
//console.log("parent: message received", e);
@robneu
robneu / wordpress-typekit-enqueue.php
Last active January 17, 2023 23:04 — forked from FernE97/typekit-enqueue.php
Enqueue typekit fonts to WordPress using wp_enqueue_scripts.
<?php
/**
* Enqueue typekit fonts into WordPress using wp_enqueue_scripts.
*
* @author Robert Neu
* @author Eric Fernandez
* @copyright Copyright (c) 2014, Robert Neu
* @license GPL-2.0+
* @link http://typekit.com
*/
@aderaaij
aderaaij / yoast
Last active February 7, 2025 14:26
Wordpress - Move yoast seo boxes to bottom of post/page
// Move Yoast to bottom
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@elijahmanor
elijahmanor / _mixins.scss
Created November 6, 2013 21:11
Placeholder SASS Mixin
/*
Usage:
$placeholder: #999;
input {
@include placeholder { color: $placeholder; }
}
*/
@mixin placeholder {
&::-webkit-input-placeholder { @content } /* webkit */
&:-moz-placeholder { @content } /* ff 4-18 */
@mannieschumpert
mannieschumpert / gist:8334811
Last active November 7, 2025 00:37
Filter the submit button in Gravity Forms to change the <input type="submit> element to a <button> element. There's an example in the Gravity Forms documentation, but it lacks the proper code to show your custom button text, AND removes important attributes like the onclick that prevents multiple clicks. I was trying to solve that.
<?php
// filter the Gravity Forms button type
add_filter("gform_submit_button", "form_submit_button", 10, 2);
function form_submit_button($button, $form){
// The following line is from the Gravity Forms documentation - it doesn't include your custom button text
// return "<button class='button' id='gform_submit_button_{$form["id"]}'>'Submit'</button>";
// This includes your custom button text:
return "<button class='button' id='gform_submit_button_{$form["id"]}'>{$form['button']['text']}</button>";
}
// Oops this strips important stuff
@nicolaracco
nicolaracco / datepicker-html5-glue.js
Created January 31, 2014 10:11
Glue to allow you to work with date inputs using the native datepicker when supported and JQuery UI as a fallback
(function() {
var setupDatePickerGlue = function($el, format) {
var elName = $el.attr("name"), // field name
elId = $el.attr("id"), // field id
elValue = $el.attr("value"); // field raw value
// remove the name to prevent value conflict on submit
$el.removeAttr("name");
// prepend an hidden input field with the same name
$el.before($("<input type='hidden' name='" + elName + "' id='raw-" + elId + "' />"));
@colelawrence
colelawrence / client.js
Created February 23, 2014 02:40
Javascript window resize timeout
// Do stuff after 100ms of no resizing
var resizeTimeout;
$(window).on("resize", function () {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function () {
// Do stuff
}, 100);
});
@jeffreyd00
jeffreyd00 / gist:fed7606c1d7e47685ecf
Created June 22, 2015 13:44
List of states in the United States for ACF
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District of Columbia
FL : Florida
@RopoMen
RopoMen / facebook_page_plugin.html
Created July 21, 2015 18:15
Simple way to resize Facebook's new Page plugin
<!--
Width 10000px is quite wide, but it has room for new "max", also because Facebook's "adaptation" means only shrinking
the Page plugin to fit smaller container. To use Page plugin with larger container than 500px (current max.) you could try
to add example Bootstrap class '.center-block' which would center the Page plugin inside larger container.
-->
<div class="row">
<div class="column-xs-6">
<div class="fb-page center-block" data-width="10000" data-adapt-container-width="true" data-href="https://www.facebook.com/facebook"></div>
</div>
</div>