Skip to content

Instantly share code, notes, and snippets.

@chrisdpeters
chrisdpeters / Issue.cfc
Last active August 25, 2015 21:57
CFWheels nestedProperties sortProperty fix
<cfcomponent extends="Model" output="false">
<cffunction name="init" output="false">
<cfscript>
hasMany(name="attemptedSolutions", shortcut="solution", dependent="delete");
nestedProperties(association="attemptedSolutions", allowDelete=true, sortProperty="sortOrder");
beforeValidation("$adjustAttemptedSolutionSortOrders");
</cfscript>
</cffunction>
<cffunction name="$adjustAttemptedSolutionSortOrders" access="private" hint="Adjusts array of attempted solutions before save happens so there aren't any null entries." output="false">
@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]
@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 / 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,
<abbr title="Hypertext Markup Language">HTML</abbr> isn't so hard to learn after all, is it?
<a href="/"><img src="logo.gif" alt="Return to home page" /></a>
@chrisdpeters
chrisdpeters / cookies.cfc
Last active August 29, 2015 14:02
Using ColdFusion as a proxy to a remote application
component extends="Controller" {
/**
* Calls remote application with session cookies for this app and posting any form or get values. Returns cfhttp results struct.
* @app Model object containing info about remote app.
*/
private function callRemoteApp(app) {
// HTTP method to call
if (isPost()) {
local.method = "post";
@chrisdpeters
chrisdpeters / breadcrumbs.css.scss
Created August 14, 2014 15:36
Responsive breadcrumbs for ZURB Foundation 5
.breadcrumbs {
@include crumb-container;
background: none;
border: 0;
margin: 0;
padding: rem-calc(3);
li {
display: none;
Alabama:
- Autauga County
- Baldwin County
- Barbour County
- Bibb County
- Blount County
- Bullock County
- Butler County
- Calhoun County
- Chambers County