Skip to content

Instantly share code, notes, and snippets.

@andyj
andyj / Application.cfc
Last active August 29, 2015 13:56
sameFORMFieldsAsArray in Railo
component output="false" {
this.name="test";
this.sameFORMFieldsAsArray = true;
public function onApplicationStart() output="false"{
return ;
}
public boolean function onRequestStart(required string thePage) output="true"{
return true;
}
@andyj
andyj / app.js
Last active August 29, 2015 14:05
node.sessions
var settings = require('./settings')
var express = require('express')
var session = require('express-session')
var app = express()
var MongoStore = require('connect-mongo')(session);
var links = '<p><a href="/link1">Link1</a> <a href="/link2">Link2</a> <a href="/link3">Link3</a></p>';
/*
Failure to set "saveUninitialized" and "resave" will generate two warnings:
@andyj
andyj / app.js
Created September 3, 2014 08:50
Parsing CSV in node.js
// Call this via CLI with $ node app.js /PathTo/Your.csv
var parse = require('csv-parse');
var fs = require('fs');
process.argv.forEach(function (val, index, array) {
/*
Position 0 == node, poistion 1 == app.js (full path) thats why we check we
need to check for args from index 2 onwards
*/
if( index > 1){
@andyj
andyj / gist:e67a85eb8bb6ff375874
Last active August 29, 2015 14:14
stacktrace - NoClassDefFoundError
java.lang.NoClassDefFoundError "railo/loader/util/Util"
railo/loader/util/Util at railo.extension.io.log.sl4j.LoggerAdapterConsole.getStacktrace(LoggerAdapterConsole.java:119):119
at railo.extension.io.log.sl4j.LoggerAdapterConsole.log(LoggerAdapterConsole.java:64):64
at railo.extension.io.log.sl4j.LoggerAdapterConsole.error(LoggerAdapterConsole.java:54):54
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:222):222
at lucee.runtime.orm.hibernate.HibernateSessionFactory.schemaExport(Unknown Source):-1
at lucee.runtime.orm.hibernate.HibernateSessionFactory.createConfiguration(Unknown Source):-1
at lucee.runtime.orm.hibernate.SessionFactoryData.setConfiguration(Unknown Source):-1
at lucee.runtime.orm.hibernate.HibernateORMEngine.getSessionFactoryData(Unknown Source):-1
<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="mon, 01 jan 2010 00:00:01 gmt">
<meta http-equiv="cache-control" content="no-cache">
</head>
<body>
<!-- stuff here -->
</body>
</html>
@andyj
andyj / ubunut-*.nix-cheat-sheet.md
Last active September 7, 2015 21:32 — forked from anonymous/ubunut-*.nix-cheat-sheet
Ubuntu / *nix cheat sheet

##File size

Display the biggest top-20 directories

du -ah . | sort -rh | head -20

Display largest files

find [directory i.e. ~/] -type f -printf "%s - %p\n" | sort -n | tail -n 100

@andyj
andyj / soundings_uuid_2_int.cfm
Created May 24, 2011 22:45
Update Soundings UUID values to INT
<cfsetting showdebugoutput="false" requesttimeout="10000" />
<h1>Update Soundings UUID values to INT</h1>
<cfset dsn = "YOUR_DSN_HERE" />
<cfquery datasource="#dsn#">DROP TABLE IF EXISTS `uuids`</cfquery>
<!--- Create the UUID table --->
<cfquery datasource="#dsn#">
@andyj
andyj / excel2html
Created September 16, 2011 04:13
Paste Excel in to HTML to create at <table>
<html>
<head>
<style>
*{
font-family: arial;
font-size: 11px;
}
table{
border-collapse: collapse;
border: 1px solid silver;
@andyj
andyj / orm_2_ids
Created November 22, 2011 22:59
Trying to create a model with 2 fields as a primary key
component persistent="true" table="tableWithTwoIds" alias="tableWithTwoIds"
{
property name="id" ormtype="int" generated="never" fieldtype="id" index="true";
property name="typeofaddress" ormtype="int" fieldtype="id" index="true" ;
}
@andyj
andyj / o2checker.cfm
Created January 25, 2012 13:21
o2 Mobile number checker
<cfset o2 = GetHttpRequestData() >
<table>
<cfloop collection="#o2.headers#" item="key" >
<tr>
<cfoutput>
<th>#key#</th>
<td>
<cfif trim( key ) EQ "x-up-calling-line-id" >
<span class="label important" >#o2.headers[key]#</span>
<cfelse>