As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
Instructions: Place this function in functions.cfm | |
In your findall(): | |
myquery=model("Mymodel").findAll(page=params.page, perPage=params.perpage,handle="myHandleName"); | |
In your view template place this code for the pagination links: | |
#bs4Pagination(paginationHandle="myHandleName",activepage="#params.page#",params="Not Required(optional params)")# | |
You can see in function arguments other parameters you can pass in from the bs4Pagination() function. ---> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// BS3 form settings | |
set(functionName="startFormTag"); | |
set(functionName="submitTag", class="btn btn-primary", value="Save Changes"); | |
set(functionName="checkBox,checkBoxTag", labelPlacement="aroundRight", prependToLabel="<div class=""checkbox"">", appendToLabel="</div>", uncheckedValue="0"); | |
set(functionName="radioButton,radioButtonTag", labelPlacement="aroundRight", prependToLabel="<div class=""radio"">", appendToLabel="</div>"); | |
set(functionName="textField,textFieldTag,select,selectTag,passwordField,passwordFieldTag,textArea,textAreaTag,fileFieldTag,fileField", | |
class="form-control", | |
labelClass="control-label", | |
labelPlacement="before", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SQL SERVER DATERANGE | |
-- Generates a list the last 30 dates. | |
WITH DATERANGE AS ( | |
SELECT | |
CAST( CONVERT( VARCHAR , DATEADD( dd , -30 , GETDATE() ) , 101 ) AS DATETIME ) AS DATE | |
UNION ALL | |
SELECT | |
DATEADD( dd , 1 , DATE ) | |
FROM DATERANGE |
Whereas cfdocument is used to create PDFs, the cfpdf tag is used to manipulate existing PDFs. With cfpdf, you can read an existing PDF, write meta-data to it, merge PDFs together, delete pages, create thumbnails of the pages, extract text & images, add or remove watermarks, manipulate headers & footers, create PDF portfolios, and deal with PDF passwords, permissions and Encryption.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset adminObj = createObject("Component", "cfide.adminapi.administrator")> | |
<cfset adminObj.login("yourpass")> <!--- change to use your CF Admin password ---> | |
<cfset rtService = createObject("component", "cfide.adminapi.runtime")> | |
<cfset fonts = rtService.getFonts()> | |
<cfdump var="#fonts#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent name="geoPlugin" output="no"> | |
<cffunction name="ipLocation" access="remote" returntype="struct" displayname="ipLocation" output="no"> | |
<!--- | |
This function takes an IP address and passes it to http://www.geoplugin.net, a free GeoLocation service that | |
returns info about where that IP address is located i.e. city, country, etc. The returned data from geoPlugin | |
is cleaned up and returned as a ColdFusion structure. | |
Where the IP address is not passed in then geoPlugin.net will use the IP of the calling page. The IP used is | |
always returned in the 'geoplugin.request' variable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="ArrayOfStructuresToQuery" access="public" returntype="query" output="false"> | |
<cfargument name="StructArray" type="any" required="true" /> | |
<cfscript> | |
KeyList=StructKeyList(arguments.StructArray[1]); | |
qbook = QueryNew(KeyList); | |
for(i=1; i <= ArrayLen(arguments.StructArray); i=i+1){ | |
QueryAddRow(qbook); | |
for(y=1;y lte ListLen(KeyList);y=y+1){ | |
QuerySetCell(qbook, ListGetAt(KeyList,y), arguments.StructArray[i][ListGetAt(KeyList,y)]); |