Skip to content

Instantly share code, notes, and snippets.

View lolajl's full-sized avatar

Lola J. Lee Beno lolajl

View GitHub Profile
@carloszaragoza
carloszaragoza / export2csv.cfm
Created October 29, 2012 21:36
Export data to CSV from ColdFusion
<!--- Read data from two datasource tables. --->
<cfquery
name="iae1" datasource="escolar_db13">
select * from v_rc_iae_pr1
</cfquery>
<cfscript>
//Use an absolute path for the files. --->
theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
theFile=theDir & "exportData.xls";
//Create two empty ColdFusion spreadsheet objects. --->
@addyosmani
addyosmani / codereview.md
Created August 25, 2011 12:11
Lessons from a JavaScript code review

#Lessons From A JavaScript Code Review

I was recently asked to review some code for a new JavaScript application and thought I might share some of the feedback I provided as it includes a mention of JavaScript fundamentals that are always useful to bear in mind. Code reviews are possibly the single biggest thing you can do to improve the overall quality of your solutions and if you're not actively taking advantage of them, you're possibly missing out on bugs you haven't noticed being found or suggestions for improvements that could make your code better.

##Challenges & Solutions

Code reviews go hand-in-hand with maintaining strong coding standards. That said, standards don't usually prevent logical errors or misunderstandings about the quirks of a programming language. Even the most experienced developers can make these kinds of mistakes and code reviews can greatly assist with catching them.

Often the most challenging part of code reviews is actually finding an experienced developer you trust to complete

@paulklinkenberg
paulklinkenberg / gist:839431
Created February 22, 2011 21:26
Get random winner
<cfhttp url="http://blog.bittersweetryan.com/2011/02/post-some-cf-code-on-github-and-win.html" />
<cfset possibleWinners = {} />
<cfset commentsHtmlArr = rematch("<dt class='comment-author.*?</dd>", rereplace(cfhttp.filecontent, '[\r\n]+', '', 'all')) />
<cfset gistURLRegex = "https://gist\.github\.com/[0-9]+" />
<cfloop from="1" to="#arrayLen(commentsHtmlArr)#" index="arrIndex">
<cfset currHtml = commentsHtmlArr[arrIndex] />
<cfif refindNoCase(gistURLRegex, currHtml)>
<cfset gistURL = reMatchNoCase(gistURLRegex, currHtml) />
<cfset gistURL = gistURL[1] />

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables