Skip to content

Instantly share code, notes, and snippets.

<a href="/"><img src="logo.gif" alt="Return to home page" /></a>
<abbr title="Hypertext Markup Language">HTML</abbr> isn't so hard to learn after all, is it?
@chrisdpeters
chrisdpeters / madness.cfm
Created April 10, 2014 20:07
Paying an invoice partially via Infusionsoft SDK
<cffunction name="payInvoicePartially" returntype="struct" hint="Creates partial payment and applies to invoice. Based on the method found here: https://github.com/novaksolutions/infusionsoft-php-sdk/blob/master/Infusionsoft/InvoiceService.php" output="false">
<cfargument name="contactId" type="numeric" required="true">
<cfargument name="invoiceId" type="numeric" required="true">
<cfargument name="creditCardId" type="numeric" required="true">
<cfargument name="merchantAccountId" type="numeric" required="true">
<cfargument name="notes" type="string" required="false" default="">
<cfargument name="bypassCommissions" type="boolean" required="false" default="false">
<cfscript>
local.sdk = CreateObject("component", "com.liquifusion.infusionsoft.core.Sdk").init(
subDomain=variables.instance.id,
@chrisdpeters
chrisdpeters / alphabetize_directives.scss
Last active August 29, 2015 13:56
Sass & CSS Style Guide
// Not recommended
body {
padding: 0;
margin: 0;
background: #f5f5f5;
line-height: 1.2;
}
// Preferred
body {
@chrisdpeters
chrisdpeters / pg_dump
Last active August 29, 2015 13:56
PostgreSQL Backup and Restore Commands
$ pg_dump -h [host address] -p [port] -U [username] [database name] -F t -f [file path]
<script>
var referrer = document.referrer;
if (referrer === '') {
referrer = 'No Referrer';
}
ga('send', 'event', '404 Error', document.location.href, referrer, 0, { nonInteraction: true });
</script>
@chrisdpeters
chrisdpeters / _layout.scss
Last active December 31, 2015 01:58
How to use the ZURB Foundation grid system without the meaningless class names http://www.chrisdpeters.com/foundation-grid-system-without-meaningless-class-names/
@import "foundation/components/grid";
.layout {
// `layout` container functions as a row
@include grid-row();
}
.layout-content {
// Mobile-first: make `layout-container` full-width
@include grid-column(12);
@chrisdpeters
chrisdpeters / form.cfm
Created February 23, 2012 23:33
Setting Global Defaults in CFWheels for Cleaner Form Code
<cfoutput>
#startFormTag(action="save")#
#textField(label="Name", objectName="user", property="name")#
#textField(label="Email", objectName="user", property="email")#
<div>#submitTag()#</div>
#endFormTag()#
</cfoutput>
@chrisdpeters
chrisdpeters / _user.cfm
Created February 23, 2012 23:20
Improving the Tutorial: Object- and Query-Driven Partials in CFWheels
<cfoutput>
<tr>
<td>#arguments.name#</td>
<td>#arguments.email#</td>
<td>#linkTo(text="Edit", action="edit", key=users.id, title="Edit #arguments.name#")#</td>
<td>#linkTo(text="Delete", action="delete", key=users.id, title="Delete #arguments.name#", confirm="Are you sure that you want to delete #arguments.name#?")#</td>
</tr>
</cfoutput>