Skip to content

Instantly share code, notes, and snippets.

View davejlong's full-sized avatar

David Long davejlong

View GitHub Profile
@davejlong
davejlong / contact-us.cfm
Created January 30, 2011 03:57
A Mura CMS component that pulls the contact information from the site settings.
<h3>Contact Information</h3>
<p><strong>[mura]$.siteConfig('site')[/mura]</strong><br />
[mura]$.siteConfig('contactAddress')[/mura]<br />
[mura]$.siteConfig('contactCity')[/mura] [mura]$.siteConfig('contactState')[/mura], [mura]$.siteConfig('contactZip')[/mura]</p>
<p>Email: <a href="mailto:[mura]$.siteConfig('contactEmail')[/mura]">[mura]$.siteConfig('contactEmail')[/mura]</a><br />
Phone: [mura]$.siteConfig('contactPhone')[/mura]</p>
<p><a href="#">Contact Us</a></p>
@davejlong
davejlong / Arithmetic.stylus
Created February 1, 2011 01:54
A few demos of Stylus, a robust CSS solution on Node.js
width = 960px
div.wrapper
width width
div.wrapper
div.left
width width - 10
margin width - width - 5
float left
div.wrapper
@davejlong
davejlong / mysql client
Created February 1, 2011 15:06
How to setup the MySQL client and MySQLDump client on Mac OS x from MySQL Workbench
#MySQL Client
ln -s /Application/MySQL\ Workbench.app/Contents/Resources/mysql /usr/bin/mysql
#MySQL Dump
ln -s /Application/MySQL\ Workbench.app/Contents/Resources/mysqldump /usr/bin/mysqldump
@davejlong
davejlong / crud-comment-conventian.cfc
Created February 11, 2011 20:26
This is my new conventian to comment CRUD controllers in my CFCs
<cfcomponent extends="Controller">
<!---Crud #### Create methods #### --->
<cffunction name="new">
<cfset user = model('user').new() />
</cffunction>
<cffunction name="create">
<cfset model('user').create(params.user) />
<cfset redirectTo(action="index",success="User #user.name# created successfully.") />
</cffunction>
@davejlong
davejlong / Mura-States
Created February 22, 2011 19:00
The values to generate drop-down's for states in Mura CMS with Distric of Columbia included
// Options List:
AL^AK^AZ^AR^CA^CO^CT^DE^DC^FL^GA^HI^ID^IL^IN^IA^KS^KY^LA^ME^MD^MA^MI^MN^MS^MO^MT^NE^NV^NH^NJ^NM^NY^NC^ND^OH^OK^OR^PA^RI^SC^SD^TN^TX^UT^VT^VA^WA^WV^WI^WY
// Label List
Alabama^Alaska^Arizona^Arkansas^California^Colorado^Connecticut^Delaware^District of Columbia^Florida^Georgia^Hawaii^Idaho^Illinois^Indiana^Iowa^Kansas^Kentucky^Louisiana^Maine^Maryland^Massachusetts^Michigan^Minnesota^Mississippi^Missouri^Montana^Nebraska^Nevada^New Hampshire^New Jersey^New Mexico^New York^North Carolina^North Dakota^Ohio^Oklahoma^Oregon^Pennsylvania^Rhode Island^South Carolina^South Dakota^Tennessee^Texas^Utah^Vermont^Virginia^Washington^West Virginia^Wisconsin^Wyoming
@davejlong
davejlong / ant-git.xml
Created March 17, 2011 15:30
A simple ant script that will commit and push to a git repo.
<?xml version="1.0"?>
<project name="Demo" default="version" basedir=".">
<macrodef name="git">
<attribute name="command" />
<attribute name="dir" default="" />
<element name="args" optional="true" />
<sequential>
<echo message="git @{command}" />
<exec executable="git" dir="@{dir}">
@davejlong
davejlong / build.properties
Created March 31, 2011 16:24
Ant script to build a complete Mura FW1 plugin and version with a build number
version.buildnumber=00
version.major=1
version.minor=1
@davejlong
davejlong / parseINI
Created April 13, 2011 19:09
Parses an INI file into a structure
public function parseINI(string codefile) void{
var i = '';
var codes = structNew();
local.sections = getProfileSections(getCodeFile());
for(local.section IN local.sections){
codes[local.section] = structNew();
local.keys = local.sections[local.section];
for(i=1;i LTE listLen(local.keys);i++){
codes[local.section][listGetAt(local.keys,i)] = getProfileString(getCodeFile(),local.section,listGetAt(local.keys,i));
@davejlong
davejlong / .bashrc
Created April 27, 2011 21:33
Git Completion in Terminal
# LL Alias
alias ll="ls -lahG"
# Git tab completion
source ~/.git-completion.bash
# Show branch in status line
PS1='[\W$(__git_ps1 " (%s)")]\$ '
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'
@davejlong
davejlong / arithmetic
Created May 12, 2011 20:04
Stylus CSS Demo
width = 960px
div.wrapper
width width
div.wrapper
div.left
width width - 10
margin width - (width - 5)
float left