Skip to content

Instantly share code, notes, and snippets.

@thebiltheory
thebiltheory / simple_method.js
Created June 11, 2016 09:13 — forked from rponte/simple_method.js
Delaying actions on keypress with jQuery
$('#mySearch').keyup(function() {
clearTimeout($.data(this, 'timer'));
var wait = setTimeout(search, 500);
$(this).data('timer', wait);
});
function search() {
$.post("stuff.php", {nStr: "" + $('#mySearch').val() + ""}, function(data){
if(data.length > 0) {
$('#suggestions').show();
@thebiltheory
thebiltheory / acf_image_function.php
Created December 29, 2015 13:30
Customized function to generates ACF costomized image display.
<?php
/**
* Custom function for ACF to display an customized image field.
*
*/
function tabs_image($img){
$image = get_sub_field($img); //replace get_sub_field by get_field if not subfield
@thebiltheory
thebiltheory / Silverpop_instapage_webhook.php
Last active December 16, 2015 16:01
Webhook to send instapage form to silverpop database
<?php
/**
* Silverpop Instapage webhook
*/
// Instapage System vars
$page_id = $_POST[ 'page_id' ];
$page_url = $_POST[ 'page_url' ];
$variant = $_POST[ 'variant' ];