Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Tierney CFJSGeek

View GitHub Profile
@CFJSGeek
CFJSGeek / Preferences.sublime-settings.json
Last active Dec 16, 2015
CFG: Sample Sublime Text 2 settings files that I use
View Preferences.sublime-settings.json
{
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 1,
"line_padding_top": 1,
"soda_classic_tabs": true,
@CFJSGeek
CFJSGeek / ColdFusionPowerShellSettings.ps1
Created May 1, 2013
Settings for ColdFusion Server to be started in the Windows PowerShell with custom sizes and colors
View ColdFusionPowerShellSettings.ps1
$pshost = get-host
$pswindow = $pshost.ui.rawui
$newsize = $pswindow.buffersize
$newsize.height = 3000
$newsize.width = 87
$pswindow.buffersize = $newsize
$newsize = $pswindow.windowsize
$newsize.height = 19
@CFJSGeek
CFJSGeek / Application Scope Dump.cfm
Created May 2, 2013
CF: Application Scope Dump #snippet
View Application Scope Dump.cfm
<cfset pageclass = "allapps">
<cfsetting requesttimeout="1000">
<br>
<cfparam name="url.sessdump" default="false">
<cfset Cfapp_list = createObject("java","coldfusion.runtime.ApplicationScopeTracker")>
<!--- <cfdump var="#CFAPP_list#"> --->
<cfset appIterator = CFAPP_list.getApplicationKeys() />
<cfset oSession = createObject("java","coldfusion.runtime.SessionTracker")>
@CFJSGeek
CFJSGeek / gist:5625001
Last active Dec 17, 2015
SQL: Insert if not updated #snippet
View gist:5625001
UPDATE Table1
SET (...)
WHERE Column1='SomeValue'
IF @@ROWCOUNT=0
INSERT INTO Table1
VALUES (...)
@CFJSGeek
CFJSGeek / Tierney Light.tmTheme
Last active Dec 17, 2015
Sublime Text 2 Light Color Scheme "Tierney Light"
View Tierney Light.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>name</key>
<string>Tierney Light</string>
@CFJSGeek
CFJSGeek / web.config
Created May 5, 2016
Taffy REST Framework IIS Rewrite Rule
View web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="api" stopProcessing="true">
<match url="^API/(.+.*)$" ignoreCase="true" />
<conditions>
<add input="{PATH_INFO}" pattern="^.*/index.cfm.*$" negate="true" />
</conditions>
@CFJSGeek
CFJSGeek / Application.cfc
Last active Mar 31, 2017
CF: Using "Access-Control-Allow-Origin" header in ColdFusion CFScript #snippet
View Application.cfc
component {
boolean function onRequestStart( required string targetPage ) {
var headers = getHttpRequestData().headers;
var origin = '';
var PC = getpagecontext().getresponse();
// Find the Origin of the request
if( structKeyExists( headers, 'Origin' ) ) {
@CFJSGeek
CFJSGeek / copyToClipboard.js
Last active Nov 29, 2017
HTML5 Copy to Clipboard
View copyToClipboard.js
// Remove copy button if copy to clipboard method is not allowed
// Note: Button detection is broken before Chrome 48
var copyBtn = document.querySelector('.copyToClip');
if (copyBtn !== null) {
if( !document.queryCommandSupported('copy') ) {
copyBtn.parentNode.removeChild(copyBtn);
};
@CFJSGeek
CFJSGeek / S3Wrapper.cfc
Last active Feb 9, 2019
Amazon Web Services (AWS) S3 Wrapper for ColdFusion
View S3Wrapper.cfc
/**
* Amazon S3 REST Wrapper
* Version Date: 2015-09-03
*
* Copyright 2015 CF Webtools | cfwebtools.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@CFJSGeek
CFJSGeek / sortObj.js
Last active Jul 22, 2020
JS: Sort a JavaScript object by key in alphabetical order case insensitive. Thanks to Arne Martin Aurlien and Ivan Krechetov for inspiration. #snippet
View sortObj.js
/**
* Sort JavaScript Object
* CF Webtools : Chris Tierney
* obj = object to sort
* order = 'asc' or 'desc'
*/
function sortObj( obj, order ) {
"use strict";
var key,
You can’t perform that action at this time.