Skip to content

Instantly share code, notes, and snippets.

View dreamstarter's full-sized avatar
💭
Building a new application!

Bryan Anderson dreamstarter

💭
Building a new application!
View GitHub Profile
@nastanford
nastanford / cfscriptQuery.cfm
Last active March 21, 2023 21:25
CFScript Query Examples
<CFSCRIPT>
myQry = new Query(datasource="cfartgallery"); // new query object
myQry.setSQL("select bookid, title, genre from app.books where bookid = :bookid"); //set query
myQry.addParam(name="bookid",value="5",CFSQLTYPE="CF_SQL_INT"); // add query param
qryRes = myQry.execute(); // execute query
writedump(qryRes.getResult().recordcount, true); // get resultcount
writedump(qryRes.getResult(), false); // dump result
writeoutput('<BR>');
</CFSCRIPT>
@timsayshey
timsayshey / CFWheels Model Logger
Last active February 17, 2023 23:25
CFWheels Model Logger
This will let you log every time a user inserts or updates a record.
So you can later say:
Tim performed insert to the "25" record in the Page table via Pages' Edit a few hours ago, etc
Create a table called Logs with the following columns:
id int primary autoinc
userid int
modelid varchar
savetype varchar
@hofmannsven
hofmannsven / README.md
Last active July 10, 2025 04:46
Git CLI Cheatsheet
@stevewithington
stevewithington / muraBootstrapCarousel.cfm
Created November 27, 2012 15:24
Mura CMS: Bootstrap Carousel Example Using Local Content Index
<!--- BEGIN: Bootstrap Carousel --->
<cfset feed=$.getBean('feed').loadBy(name='Your FeedName Goes Here')>
<cfset iterator=feed.getIterator()>
<cfif iterator.hasNext()>
<div id="myCarousel" class="carousel slide">
<!--- Carousel items --->
<div class="carousel-inner">
<cfset idx = 0>
<cfloop condition="iterator.hasNext()">
<cfset item=iterator.next()>
@rip747
rip747 / gist:2853902
Created June 1, 2012 17:38
implementing a CFWheels service layer
<!--- add the following to the events/onapplicationstart.cfm --->
<cffunction name="initServices" returntype="void" hint="I initialize the services objects for this app">
<cfset var loc = {}>
<cfset application.$_ServiceObjects = {}>
<cfdirectory action="list" directory="#expandPath('services')#" name="loc.services"/>
<cfloop query="loc.services">
<cfset application.$_ServiceObjects[ListFirst(name, '.')] = createObject("component", "services.#ListFirst(name, '.')#").init()>
</cfloop>
</cffunction>
<cfset initServices()>
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@bennadel
bennadel / Application.cfc
Created March 20, 2012 14:25
ColdFusion 10 - Using WebSockets To Push A Message To A Target User
<cfscript>
// NOTE: CFScript added for Gist color-coding only. Remove.
component
output="false"
hint="I define the application settings and event handlers."
{
// Define the application settings.
@ChuckJHardy
ChuckJHardy / app.rake
Created May 29, 2011 12:34
Rake Task for Database Population
------------ From Rake Task
namespace :app do
# Checks and ensures task is not run in production.
task :ensure_development_environment => :environment do
if Rails.env.production?
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)"
end
end