Skip to content

Instantly share code, notes, and snippets.

@RobertCalise
RobertCalise / install-fuelphp-on-dotcloud.sh
Last active December 27, 2015 23:49 — forked from kenjis/install-fuelphp.sh
Download/install FuelPHP from GitHub into a local repo, create new dotCloud application, and push the application live in a single command.
#!/bin/sh
# FuelPHP Install Script
#
# @author Kenji Suzuki https://github.com/kenjis
# @copyright 2011 Kenji Suzuki
# @license MIT License http://www.opensource.org/licenses/mit-license.php
if [ $# -lt 2 ]; then
echo "Install FuelPHP and Create Application Repository"
#!/bin/sh
# Laravel Install Script
# Based on the FuelPHP Install Script by Kenji Suzuki
# https://gist.github.com/kenjis/1479807
#
# @author Robert Calise http://github.com/RobertCalise
# @copyright 2014 Robert Calise
# @license MIT License http://www.opensource.org/licenses/mit-license.php
@RobertCalise
RobertCalise / custom_field_lookup.php
Created May 2, 2014 17:31
Infusionsoft Custom Field Lookup
<?php
// Require Infusionsoft PHP-SDK: https://github.com/infusionsoft/PHP-iSDK
require_once('isdk.php');
$api = new iSDK;
$api->cfgCon('appname');
// What code was entered?
$code = $_POST['code'];
@RobertCalise
RobertCalise / translate.html
Last active August 29, 2015 14:04
Simple text replacement with jQuery.
<!DOCTYPE html>
<html>
<head>
<title>jQuery Translation Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var translate = {
"Hello, world!": "Bonjour tout le monde!",
"This is an example.": "Ceci est un exemple."
@RobertCalise
RobertCalise / gist:19f3fbaad1d6f8cae2d9
Last active August 29, 2015 14:11
Quick (hacky) way to ensure a PHP date is in the future.
<?php
// Assuming the date you're looking for is January 2:
$when = 'January 2';
// Verbose method:
if(($date = strtotime($when)) < time()) {
$date = strtotime('+1 year', $date);
}

Keybase proof

I hereby claim:

  • I am robertcalise on github.
  • I am robertcalise (https://keybase.io/robertcalise) on keybase.
  • I have a public key whose fingerprint is 9834 6E7E BB03 D290 A179 5570 E109 3929 3C43 590A

To claim this, I am signing this object:

@RobertCalise
RobertCalise / infusionsoft-timezone-field.html
Created March 21, 2017 16:11
Fill Infusionsoft Timezone Field
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.6/jstz.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
var tz = jstz.determine().name(),
selected = jQuery('#Contact0TimeZone option[value="' + tz + '"]').prop('selected', true).val();
if(selected === undefined) {
/* If no match found, default to America/New_York as a fallback */
jQuery('#Contact0TimeZone option[value="America/New_York"]').prop('selected', true);
}
});
@RobertCalise
RobertCalise / example.html
Created March 30, 2017 00:16
Example: Change Infusionsoft web form field type from "text" to "password" in order to mask input
<!-- assumes a field with an id of inf_field_Company exists on the page -->
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#inf_field_Company').attr('type', 'password');
});
</script>
@RobertCalise
RobertCalise / infusionsoft-customize-review-order-button-label.html
Last active June 24, 2017 16:43
Customize "review order" button label in Infusionsoft Shopping Cart theme.
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('a#reviewOrderButton').html('Proceed to Checkout');
});
</script>
@RobertCalise
RobertCalise / infusionsoft-agree-terms-checkbox.html
Created May 16, 2017 14:38
Inject a required "I agree to the Terms" checkbox into an Infusionsoft web form
<script type="text/javascript">
var terms_name = 'Terms &amp; Conditions',
terms_link = 'https://yourwebsite.com/link/to/terms';
jQuery(document).ready(function() {
jQuery('.infusion-submit').before('<div style="margin-bottom: 5px;"><input id="inf_option_IagreetotheTermsConditions" name="inf_option_IagreetotheTermsConditions" style="margin-right:3px;" type="checkbox" value="232" /><label for="inf_option_IagreetotheTermsConditions">I agree to the <a href="'+terms_link+'" target="_blank">'+terms_name+'</a></label></div>');
jQuery('.infusion-form').on('submit', function(e) {
if(!jQuery('#inf_option_IagreetotheTermsConditions').is(':checked')) {
e.preventDefault();
alert('You must agree to the ' + terms_name + ' before submitting this form!');