Help

The code editor on this site has many options that you can control via url parameters as well as within the editor itself. This can give you a very helpful way to share code snippets. Here are some of the options:

In-Editor Options

On any editor you can press the button to change the editor's theme and CFML engine (note: you can also do so via url parameters - see below).

You can also maximize the editor by clicking the button. Click it again to toggle back to the default size.

URL Parameters

CFML Engine

One of the most powerful features of trycf.com is that it allows you to run the same code against all of the leading CFML engines. To force the default engine to a specific flavor, supply the engine parameter with one of the following:

Example: https://trycf.com?engine=lucee
  • acf :Adobe ColdFusion 10
  • acf11 :Adobe ColdFusion 11
  • railo :Railo 4.2
  • lucee :Lucee 4.5
  • lucee5.0.0.45 :Lucee 5.0.0.45 (beta)

Editor Theme

The cfml editor used here has many different themes to choose from. You can change this theme by using the url parameter theme with one of the following options:

Bright Themes:

Example: https://trycf.com?theme=cobalt
  • chrome :Chrome
  • clouds :Clouds
  • crimson_editor :Crimson Editor
  • dawn :Dawn
  • dreamweaver :Dreamweaver
  • eclipse :Eclipse
  • github :GitHub
  • solarized_light :Solarized Light
  • textmate :TextMate
  • tomorrow :Tomorrow
  • xcode :XCode

Dark Themes

  • ambiance :Ambiance
  • chaos :Chaos
  • clouds_midnight :Clouds Midnight
  • cobalt :Cobalt
  • idle_fingers :idleFingers
  • kr_theme :krTheme
  • merbivore :Merbivore
  • merbivore_soft :Merbivore Soft
  • mono_industrial :Mono Industrial
  • monokai :Monokai
  • pastel_on_dark :Pastel on dark
  • solarized_dark :Solarized Dark
  • terminal :Terminal
  • tomorrow_night :Tomorrow Night
  • tomorrow_night_blue :Tomorrow Night Blue
  • tomorrow_night_bright :Tomorrow Night Bright
  • tomorrow_night_eighties :Tomorrow Night 80s
  • twilight :Twilight
  • vibrant_ink :Vibrant Ink

Code Sharing

Github Gists

Sharing code snippets is made easy by integrating with Github Gists. If you already have a gist you would like to share you can use one of the following url patterns to do so:

  • https://trycf.com/gist/{your gist ID here} : Obviously, use your real Gist ID. This gives you the default embedded editor
  • https://trycf.com/editor/gist/{your gist ID here} : Again, use your real Gist ID. This gives you the full-screen editor

Setup Code

Sometimes to share an example you need some environment setup that you don't necessarily need in your code example (i.e. setup a query object). In these cases you can provide a second gist that will be executed prior to your code to setup environments.

To use this feature you'll need to do two things:

  1. Create a second Github Gist
  2. Add the setupCodeGistId url parameter indicating the gist Id you previously created
For example:
  • https://trycf.com/gist/{your gist ID here}?setupCodeGistId={your second gist ID here} : Obviously, use your real Gist IDs. This gives you the default embedded editor
  • https://trycf.com/editor/gist/{your gist ID here}?setupCodeGistId={your second gist ID here} : Again, use your real Gist IDs. This gives you the full-screen editor
Consider the folllowing example where I am setting up a query object to experiment with queryExecute() function (since we don't have access to a real DB yet)
Note: You will be able to inspect both Gists using the link above the editor

Note: You can also specify the engine inline here by appending /{your engine selection}, so for example:

Pastebin Pastes

Pretty much the same idea as Gists, but using the Pastebin service:

Note that the full-screen "editor" mode does not support pastebin
  • https://trycf.com/pastebin/{your pastebin ID here} : Obviously, use your real Pastebin ID. This gives you the default embedded editor

Editor Keyboard Shortcuts

Within the editor you also have a couple of keyboard shortcuts:

Press CTL+S to automatically save a Github Gist. This returns the url (including the currently selected engine) that you could copy/paste to those you intend to share it with.

Press CTL+Enter to automatically run the code.