Skip to content

Instantly share code, notes, and snippets.

View seancoyne's full-sized avatar

Sean Coyne seancoyne

View GitHub Profile
@seancoyne
seancoyne / ScopeFacade.cfc
Created April 6, 2011 20:50
A simple ColdFusion scope facade
<!---
Scope Facade
Author: Sean Coyne (http://n42designs.com)
Copyright 2011 and Beyond. All Rights Reserved.
--->
<cfcomponent output="false">
<cfset variables.instance = {} />
<cfset variables.instance.scopename = '' />
<cfset variables.instance.scope = '' />
@seancoyne
seancoyne / twitterDate.cfm
Created June 9, 2011 20:06
Convert Twitter Date to ColdFusion Date - UDF
<cfscript>
function twitterDate(date,offset) {
var retDate = listtoarray(date, " ");
var thisDay = retDate[1];
var thisMonth = retDate[2];
var thisDate = retDate[3];
var thisTime = timeformat(retDate[4], "h:mm tt");
var thisYear = retDate[6];
var thisReturn = "";
var thisFormat = "#thisMonth#, #thisDate# #thisYear#";
@seancoyne
seancoyne / example.js
Created July 22, 2011 19:26
Example show Javascript
$("a.tab").click(function(event){
event.preventDefault();
var id = $(this).attr('id'); // gets the ID of whatever you clicked on
var a = id.split("_"); // a is now an array with 2 items ("link" and the number)
var num = a[1]; // num is now the number of the "link_x" link that was clicked
@seancoyne
seancoyne / iChatGrowl.applescript
Created August 11, 2011 21:52
Applescript for iChat Growl (1.2.2) Notiifications
on notify_growl(theName, theTitle, theDescription, theImage)
tell application "GrowlHelperApp"
notify with name theName title theTitle description theDescription application name "iChat" image theImage
end tell
end notify_growl
using terms from application "iChat"
@seancoyne
seancoyne / LabelUtil.as
Created August 23, 2011 22:02
Scale Flex label text to fit available width
import flash.text.AntiAliasType;
import flash.text.Font;
import flash.text.GridFitType;
import flash.text.TextLineMetrics;
import mx.controls.Label;
import mx.core.Application;
import mx.core.UITextFormat;
import mx.styles.CSSStyleDeclaration;
import mx.styles.StyleManager;
@seancoyne
seancoyne / slider.cfc
Created September 20, 2011 21:11
FarCry Slider Formtool
<cfcomponent extends="farcry.core.packages.formtools.numeric" name="slider" displayname="slider" hint="Field component to display a slider">
<cfproperty name="ftMin" required="false" type="numeric" default="0" hint="The minimum value of the slider." />
<cfproperty name="ftMax" required="false" type="numeric" default="10" hint="The maximum value of the slider." />
<cfproperty name="ftStep" required="false" type="numeric" default="1" hint="Determines the size or amount of each interval or step the slider takes between min and max. The full specified value range of the slider (max - min) needs to be evenly divisible by the step." />
<cfproperty name="ftOrientation" required="false" type="string" default="horizontal" options="horizontal,vertical" hint="This option determines whether the slider has the min at the left, the max at the right or the min at the bottom, the max at the top. Possible values: 'horizontal', 'vertical'." />
<cffunction name="edit" access="public" output="true" returntype="string" hi
@seancoyne
seancoyne / iChatGrowl.applescript
Created October 6, 2011 02:34
Applescript for iChat Growl (1.3) Notifications
on notify_growl(theName, theTitle, theDescription, theImage)
tell application "Growl"
if (theImage is not null) then
notify with name theName title theTitle description theDescription application name "iChat" image theImage
else
notify with name theName title theTitle description theDescription application name "iChat"
end if
end tell
@seancoyne
seancoyne / sourcetree.regex
Created February 1, 2012 20:25
SourceTree RegEx Commit Message Replacement
Regex Pattern: #(\d{1,})
Replace With: <a href="URL_GOES_HERE/$1">#$1</a>
@seancoyne
seancoyne / gist.cfc
Created February 12, 2012 18:47
Gist renderer for BlogCFC
<!---
Save this file as /org/camden/blog/render/gist.cfc
In your entries you can then include a Github gist using the following syntax:
<gist id="[gist id]">
Example: <gist id="1810183"> would embed this gist into a blog entry.
@seancoyne
seancoyne / build.cfm
Created February 29, 2012 00:33
ColdFusion script to create a new SVN tag from trunk
<cfsetting enablecfoutputonly="true" />
<!--- @@displayname: Build Script --->
<!--- @@author: Sean Coyne (www.n42designs.com) --->
<!--- @@description: Copies the current trunk to a new tag --->
<!--- set the following variables to the proper URI for each (trunk, tags) --->
<cfset variables.svnUri = "https://base/url/path" />
<cfset variables.trunkUri = variables.svnUri & "/trunk" />
<cfset variables.tagsUri = variables.svnUri & "/tags" />