Skip to content

Instantly share code, notes, and snippets.

[
{ "id": 1, "first_name": "Linzy", "last_name": "Shillington", "email": "lshillington0@redcross.org", "gender": "Female", "ip_address": "46.126.225.111" },
{ "id": 2, "first_name": "Garrick", "last_name": "Girardengo", "email": "ggirardengo1@gizmodo.com", "gender": "Male", "ip_address": "99.185.134.135" },
{ "id": 3, "first_name": "Nico", "last_name": "O'Hanlon", "email": "nohanlon2@lycos.com", "gender": "Male", "ip_address": "110.150.13.31" },
{ "id": 4, "first_name": "Lefty", "last_name": "Raggitt", "email": "lraggitt3@shareasale.com", "gender": "Male", "ip_address": "71.136.126.255" },
{ "id": 5, "first_name": "Edwin", "last_name": "Sinton", "email": "esinton4@mac.com", "gender": "Male", "ip_address": "118.202.143.247" },
{ "id": 6, "first_name": "Janice", "last_name": "Heap", "email": "jheap5@t.co", "gender": "Female", "ip_address": "91.33.106.198" },
{ "id": 7, "first_name": "Olwen", "last_name": "Slocom", "email": "oslocom6@census.gov", "gender":
<cfscript>
http = new http(url='https://gist.githubusercontent.com/abramadams/17ffea14993a441780a6edc85608415b/raw/55c7fa54cc5765ec5c5e1b04f8a2d12b3a7fc469/peopleData.json');
jsonData = deSerializeJSON( http.send().getPrefix().fileContent );
people = queryNew(
"id, first_name, last_name, email, gender, ip_address",
"integer, varchar, varchar, varchar, varchar, varchar", jsonData );
</cfscript>
@abramadams
abramadams / trycf-gist.cfm
Last active September 30, 2015 22:09 — forked from anonymous/trycf-gist.cfm
TryCF Gist
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc= sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<cfoutput>#buildTable()#</cfoutput>
<cfscript>
function buildTable( version = "all" ){
var versionMap = {"10": 7770, "11": 10206, "all": "null" };
var surl = "https://bugbase.adobe.com/index.cfm?event=qSearchBugs&page=1&pageSize=8000&gridsortcolumn=AD_S_CREATED_DT&gridsortdirection=ASC&type=null&product=1149&version=#versionMap[version]#&prodArea=10&state=OPEN&status=null&reason=null&numFiles=&numFilesOp=%3D&numVotes=&numVotesOp=%3D&creationDate=&creationDateOp=%3D&priority=null&failureType=null&frequency=null&reportedBy=&fixedInBuild=&foundInBuild=&appLanguage=-&osLanguage=-&platform=-&browser=-&title=&description=&testConfig=&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=0BB3E5E1EDECE92681695E31F5D9F568&_cf_rc=19";
<cfscript>
nil = javaCast( "null", "" );
test = {
"0 request": isNull( request )
,"01 server": isNull( server )
,"02 form": isNull( form )
,"03 url": isNull( url )
,"04 33": isNull( 33 )
,"05 {}": isNull( {} )
,"06 not_real": isNull( not_real )
<select id="minutes">
<cfoutput>
<cfloop from="1" to="60" index="m">
<option>#numberFormat(m,'00')#</option>
</cfloop>
</cfoutput>
</select>
<cfscript>
writeOutput( abs( -300 ) );
</cfscript>
"use strict"
LIVERELOAD_PORT = 35728
lrSnippet = require("connect-livereload")(port: LIVERELOAD_PORT)
# var conf = require('./conf.'+process.env.NODE_ENV);
mountFolder = (connect, dir) ->
connect.static require("path").resolve(dir)
# # Globbing
@abramadams
abramadams / gist:dba95cc6009fc3bd6468
Last active August 29, 2015 14:09
ISO Date/Time To CF Date/Time Regex
<cfscript>
date = '2014-12-14T08:28:52.796Z';
convertedDate = date.ReplaceFirst(
"^.*?(\d{4})-?(\d{2})-?(\d{2})T([\d:]+).*$",
"$1-$2-$3 $4"
);
writeDump( [ date, convertedDate ] );
@abramadams
abramadams / Application.cfc
Created July 18, 2014 19:19
Simple CF-ORM one-to-one example
component {
this.name = hash(getCurrentTemplatePath());
this.sessionManagement = true;
this.sessionTimeout = CreateTimeSpan(0, 1, 0, 0);
this.ormenabled = true;
this.mappings['/'] = expandPath('.');
this.datasource = 'sandbox';
this.ormsettings = {
@abramadams
abramadams / jvm.config
Created July 11, 2014 19:40
Generic JVM config for CF9 on Linux
#
# VM configuration
#
# Where to find JVM, if {java.home}/jre exists then that JVM is used
# if not then it must be the path to the JRE itself
java.home=/opt/coldfusion9/runtime/jre/
#
# If no java.home is specified a VM is located by looking in these places in this
# order:
#