Skip to content

Instantly share code, notes, and snippets.

@s992
s992 / caller.cfm
Created October 24, 2011 03:08
MuraProxy plugin deployment
<!--- Instantiate the MuraProxy webservice --->
<cfset muraProxy = createObject( "webservice", "http://localhost/muraFork/MuraProxy.cfc?wsdl" ) />
<!--- Authenticate --->
<cfset authToken = muraProxy.login( 'admin', 'admin', 'default' ) />
<!--- Create our args struct and serialize it to place in the URL --->
<cfset args = structNew() />
<cfset args.siteID = 'default' />
<cfset args = serializeJSON( args ) />
@s992
s992 / ColdMVC.bat
Created December 4, 2011 03:49
Batch file for creating ColdMVC directory structure
::
:: Directory structure based on the one listed at
:: http://www.coldmvc.com/guide/introduction/directory-structure
:: and some of my own observations on file content.
::
@ECHO OFF
IF "%1" == "" GOTO NeedsArgument ELSE GOTO BuildFolderStructure
@s992
s992 / index.cfm
Created December 8, 2011 03:08
Integrating SendGrid with CF
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>SendGrid Demo</title>
</head>
<body>
<form action="process.cfm" method="POST">
<div>
<label for="emails">
@s992
s992 / create.cfm
Created March 20, 2012 20:46
Programmatically Creating New Datasources
<!--- Plug in an existing datasource --->
<cfquery name="qDatabases" datasource="YOUR_DSN_HERE">
SHOW DATABASES;
</cfquery>
<!--- Log in to the CF admin with your password --->
<cfset adminAPI = createObject( 'component', 'cfide.adminapi.administrator' ) />
<cfset adminAPI.login( 'YOUR_PASSWORD_HERE' ) />
<!--- Loop over our query and create datasources for each database in MySQL --->
<cfscript>
// Ignore cfscript tags, they're just for syntax highlighting.
component {
...
function onRequestStart() {
if( structKeyExists( url, 'ormDropCreate' ) ) {
dropTables();
ormReload();
<cfscript>
string = "I'm a string!";
numeric = 12345;
boolean = true;
chromelogger.log( string, numeric, boolean );
</cfscript>
<cfscript>
function test() {
return "I break when serialized!";
}
writeOutput( serializeJSON( test ) );
</cfscript>
@s992
s992 / DiceRoller.groovy
Created February 21, 2014 19:40
Dice Roller
import javax.swing.JOptionPane
// for: http://www.raymondcamden.com/index.cfm/2014/2/21/Friday-Puzzler-Rolling-the-die
class DiceRoller {
static Random random = new Random()
static void main( String[] args ) {
String roller = JOptionPane.&showInputDialog "Enter your roll:"
@s992
s992 / geb.groovy
Created June 26, 2014 02:46
Learning geb!
import geb.Browser
import geb.Page
import geb.Module
class NavigationLink extends Module {
def linkText
static content = {
link { $("a", text: linkText) }
@s992
s992 / gist:23d35ebad8e8988c02c5
Created September 7, 2014 22:23
Migrating Octopress to a New Computer
$ git clone [email protected]:username/username.github.com.git
$ cd username.github.com
$ git checkout source
$ mkdir _deploy
$ cd _deploy
$ git init
$ git remote add origin [email protected]:username/username.github.com.git
$ git pull origin master
$ cd ..