This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var url = require('url'); | |
var fs = require('fs'); | |
var XmlStream = require('xml-stream'); | |
var config = require('./config.json'); // already parsed | |
var downloadFile = function( targetUrl ) { | |
var xmlItem = ""; | |
var timestamp = parseInt( new Date().getTime() / 1000 ); | |
var options = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
http.createServer( function( req, res ) { | |
res.writeHead( 200, { 'Content-Type' : 'text/plain' } ); | |
res.end( 'Hello World\n' ); | |
} ).listen( 1337, '127.0.0.1' ); | |
console.log( 'Server running at http://127.0.0.1:1337/' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function() { | |
var timeoutDuration = 30; | |
var mouseMoved = 0; | |
var keyPressed = 0; | |
var getDocument = function() { | |
if ( window ) { | |
return window.document; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* convert list to a list with numeric elements | |
* | |
* @param required string numList source list with elements] | |
* @return list with numeric items | |
*/ | |
string function toNumericList( required string numList ) { | |
var numListLen = listLen( arguments.numList ); | |
var result = ""; | |
if ( numListLen > 0 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Build query string and parameter array by using the placeholders like "__name__". | |
* It is mandatory to use sqlQuery or sqlName. Otherwise no sql will be used! | |
* | |
* @param optional string sqlQuery pass a query string to read and convert | |
* @param optional string sqlName pass the name of the global sql struct property instead of sqlQuery | |
* @param optional struct params map struct with key to replace and value to use in sql properties array | |
* @return a struct containing the processes "sql" as string and the "params" as array | |
*/ | |
struct function queryMake( string sqlQuery, string sqlName, struct params ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -iname '*.cfc' | xargs grep 'string' -sl | |
find . | xargs grep 'string' -sl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Status line | |
set statusline=%F%m%r%h%w\ %{&ff}\ %Y\ a/h:%03.3b/%02.2B\ %04l,%04v\ %p%%\ %L\ lines | |
set laststatus=2 | |
"Tabstop | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set backspace=indent,eol,start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @class Acme.TYPO3.Foo.ClassWithConstructor | |
* | |
* This class has a constructor! | |
* | |
* @namespace Acme.TYPO3.Foo | |
* @extends TYPO3.TYPO3.Core.SomeOtherClass | |
* | |
* @constructor | |
* @param {String} id The ID which to use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is a method declaration; and the | |
* explanatory text is followed by a newline. | |
* | |
* @param {String} param1 Parameter name | |
* @param {String} param2 (Optional) Optional parameter | |
* @return {Boolean} Return value | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isHtml5(){ | |
var test_canvas = document.createElement("canvas") //try and create sample canvas element | |
return (test_canvas.getContext)? true : false //check if object supports getContext() method, a method of the canvas element | |
} |