Skip to content

Instantly share code, notes, and snippets.

@jafoca
jafoca / custom.js
Last active December 22, 2021 17:07
Display Gravity Form inside Prettyphoto lightbox / modal window
jQuery(document).ready(function($){
//Detect whether or not the hack is needed - are we using the modal form on this page?
if ( jQuery('#brochure_form_modal').length ) {
//only do this after the DOM is fully loaded the first time, otherwise the modal will open on page load!
jQuery(window).load(function(){
jQuery(document).bind('gform_post_render', function(){
//Tell prettyphoto to re-open the inline (hidden) element after submit - this fires when there are validation errors
@jafoca
jafoca / log output
Last active August 29, 2015 13:57
Log output - delayed_job Job NilClass# error
/////////////////////////////////////////////////////////////////
Below is the log output from the LIVE environment when Heroku Scheduler calls the "rake jobs:workoff" task:
/////////////////////////////////////////////////////////////////
2014-03-29T14:52:15.693202+00:00 heroku[api]: Starting process with command `bundle exec rake jobs:workoff && curl https://nosnch.in/7f302971c2` by scheduler@addons.heroku.com
2014-03-29T14:52:19.094078+00:00 heroku[scheduler.6256]: Starting process with command `bundle exec rake jobs:workoff && curl https://nosnch.in/7f302971c2`
2014-03-29T14:52:19.692272+00:00 heroku[scheduler.6256]: State changed from starting to up
2014-03-29T14:52:24.918291+00:00 app[scheduler.6256]: Connecting to database specified by DATABASE_URL
2014-03-29T14:52:26.393321+00:00 app[scheduler.6256]: [Worker(host:8f7be6df-5b45-4fa5-a202-e386234c2a5c pid:3)] Job NilClass# (id=5) RUNNING
2014-03-29T14:52:26.371554+00:00 app[scheduler.6256]: [Worker(host:8f7be6df-5b45-4fa5-a202-e386234c2a5c pid:3)] Job
@jafoca
jafoca / jQueryUI-business-days-filter.js
Created September 18, 2012 16:23
Restrict the options on a jQueryUI date picker to allow only weekdays at a minimum of 2 business days in the future
$(document).ready(function() {
$('.date').datepicker({
dateFormat: 'yy-mm-dd',
minDate : setRestrictedDates(),
beforeShowDay: $.datepicker.noWeekends
});
});
function setRestrictedDates(){