Skip to content

Instantly share code, notes, and snippets.

@andyj
andyj / web service error.cfm
Last active December 17, 2015 18:09
Fatal Error: URI=https://www.someurl.co.uk/RegService.asmx Line=110: The element type "p" must be terminated by the matching end-tag "
<cfscript>
wsUrl = "https://www.someurl.co.uk/RegService.asmx";
ws = CreateObject("webservice", wsUrl );
</cfscript>
@andyj
andyj / web service error fixed.cfm
Created May 25, 2013 23:10
fixed the error "Fatal Error: URI=https://www.someurl.co.uk/RegService.asmx Line=110: The element type "p" must be terminated by the matching end-tag " by adding ?wsdl to the URL
<cfscript>
wsUrl = "https://www.someurl.co.uk/RegService.asmx?wsdl";
ws = CreateObject("webservice", wsUrl );
</cfscript>
@andyj
andyj / p3p cfheader.cfm
Created May 28, 2013 14:32
A P3P policy to make IE handle session variables within an iFrame
<!--- A P3P policy to make IE handle session variables within an iFrame --->
<cfheader name="P3P" value="CP='NOI DSP NID TAIo PSAa OUR IND UNI OTC TST'" />
@andyj
andyj / javascript_fallback_solution.htm
Created July 6, 2013 06:53
CDN Javascript fallback solution
<!-- Try and load your CDN jQuery file-->
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<!-- Check for jQuery to be load, if not load in local copy -->
<script>
// n.b. \x3C is hexadecimal for <. You put this in their so the browser does not stop parsing the block of code
window.jQuery || document.write('<script src="/assets/js/jquery-1.10.2.min.js">\x3C/script>')
</script>
@andyj
andyj / example_yepnojs.js
Created July 6, 2013 06:59
Example of yepnope test object
yepnope([{
test : /* boolean(ish) - Something truthy that you want to test */,
yep : /* array (of strings) | string - The things to load if test is true */,
nope : /* array (of strings) | string - The things to load if test is false */,
both : /* array (of strings) | string - Load everytime (sugar) */,
load : /* array (of strings) | string - Load everytime (sugar) */,
callback : /* function ( testResult, key ) | object { key : fn } */,
complete : /* function */
}, ... ]);
@andyj
andyj / newBashProfile.sh
Last active December 23, 2015 16:39
Create new ~/.bash_profile on the mac
# create the ~/.bash_profile
touch ~/.bash_profile
# Set the environment variable
echo export NODE_ENV=production >> ~/.bash_profile
# The source command makes the NODE_ENV variable available in your current shell
source ~/.bash_profile
# Check it works
@andyj
andyj / whatEnvironment.js
Created September 22, 2013 21:25
Node.js output environment setting
console.log(process.env.NODE_ENV);
@andyj
andyj / glyphicon_example.html
Created September 26, 2013 23:38
If you use Bootswatch files from the bootstrap CDN then to get the Glyphicons working you need to include glphicons css file @ http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css
<html>
<head>
<link href="//netdna.bootstrapcdn.com/bootswatch/3.0.0/flatly/bootstrap.min.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
</head>
<body>
<span class="alert alert-danger">Glyphicon example</span>
<hr>
<div class="the-icons">
<span class="glyphicon glyphicon-glass"></span>
@andyj
andyj / pgdebug.htm
Created September 30, 2013 16:06
phonegap debug not working
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
<script src="http://debug.phonegap.com/target/target-script-min.js#8A4EA003-A0B5-4683-BDD8-BF4CB521DAEA"></script>
</head>
<body>
@andyj
andyj / blogcfc-export-to-ghost.sql
Last active December 25, 2015 19:59
Some SQL (mysql) for exporting from BlogCFC to Ghost (www.ghost.org)
-- This was tested on Ghost v0.3.0
-- I have 2 databases set up which I reference in my SQL - you need to change accordingly
-- 1: ajdev (this holds my BlogCFC data)
-- 2: ghost-dev (this holds my Ghost blog data)
--
-- 1) Check for duplicate alias's
-- I don't know how I got these but I did, so clean your entries up first but looking
-- for duplicates and changing the `alias` value to something unique.
SELECT lower(`alias`) , count(lower(`alias`) )