Skip to content

Instantly share code, notes, and snippets.

@nifl
nifl / apache-tomcat-railo-multiweb.md
Last active December 27, 2015 14:59
Updated instructions on setting up multiple web instances of Railo 4 with Tomcat 7.0.42 and Apache on Mac OS 10.9. The original instructions appeared on Sean Corfields blog http://corfield.org/entry/Railo_on_Tomcat__multiweb and http://corfield.org/entry/Railo_for_Dummies_Part_IV_Appendix. Also credit to Jamie Krug for his updated post on proxyi…

Tomcat

In the Tomcat folder create a railo/ folder and copy in the contents of the unzipped Railo JARs ZIP file (or from the WEB-INF/lib/ folder of the unzipped Railo WAR file). In the Tomcat conf/ folder, edit catalina.properties and find the common.loader class path. We're going to add the Railo JARs to the common class path so that every web application can have Railo CFML pages. The new common.loader definition should look like this (all on one line, no spaces): common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/railo,${catalina.home}/railo/*.jar

Note: embedding Railo directly in Tomcat like this means that you will end up with a generated WEB-INF/ folder in each webroot, containing some Railo files (about 2MB).

Unless you're going to use the default web applications that come with Tomcat, this is a good time to empty the Tomcat webapps/ folder. You could create a default/ folder in the Tomcat folder and move everything from webapps/ to default/

@nifl
nifl / ghostinstall.md
Last active January 2, 2016 15:39
INSTALLING GHOST ON UBUNTU AND EC2 adapted from http://aexmachina.info/installing-ghost-on-ubuntu-and-aws-ec2/

PREREQUISITES

  • Node.js
  • Ruby
  • Bundler

GET GHOST

This one's pretty simple, just change directory to somewhere sensible and run the following commands:

dirName="my-blog"
@nifl
nifl / responsive.md
Last active August 29, 2015 13:57
Responsive notes

Viewport

Without viewport META tag the mobile browser will render desktop site.

Basic viewport declaration

<meta name="viewport">

<meta name="viewport" content="width=device-width">
@nifl
nifl / js-primitives.md
Created April 3, 2014 17:55
JS Primitives, Variables, and Operators

Primitives

  • String
  • Number
  • Boolean
  • Undefined
  • Null

Variables

@nifl
nifl / js-arrays.md
Created April 3, 2014 17:56
JS Arrays

Arrays

Arrays are data structures with automatically indexed positions. Array indices are zero–based.

Creating arrays

Literal notation

JSLint suggests literal notation for creating arrays and objects. Allows for initializing values.

@nifl
nifl / js-loops.md
Created April 3, 2014 17:57
JS Loops

Loops

While loops are initialized outside of the loop, eg in a var

var number = 0;
while (number < 10) {
    console.log(number);
    number++; // incrementer inside loop
}
@nifl
nifl / js-conditionals.md
Last active August 29, 2015 13:58
JS Conditionals

Conditionals

Conditionals execute certain code that meet specific conditions

Conditional Statements

If, Else

if (someColor == blue) {
@nifl
nifl / js-builtins.md
Created April 3, 2014 17:59
JS Built-ins

Built–Ins

alert() Sends message to user in small pop-up window

confirm() Asks for consent to move forward. Cancel returns false, OK returns true

prompt() Sends a message and retrieves an entry.

typeof() Useful for checking a variable's contents

@nifl
nifl / js-functions.md
Last active September 17, 2022 04:24
JS Functions

Functions

Functions are first–class citizens in JS, meaning that they can be passed around like any other type of data, eg, variables. http://en.wikipedia.org/wiki/First-class_function

Declared function

Declared functions build in memory immediately when the program loads.

Basic syntax

@nifl
nifl / js-closures.md
Created April 3, 2014 18:01
JS Closures

Closures

A closure is a function returned from a function complete with external variables.

The entire contents of an inner function will still be available outside the outermost function.

function simpleClosure () {
	var x = 4;
	function closeX (){