Skip to content

Instantly share code, notes, and snippets.

@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-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 (){
@nifl
nifl / js-hoisting.md
Created April 3, 2014 18:01
JS Hoisting

Hoisting - Concept of program load order

First, memory is set aside for all necessary variables and declared functions.

// How a function is built by humans
function sumOfSquares (a, b) {
  
  var x = add(a*a, b*b);
 return x;
<?php
/**
* Custom configuration bootstrap file for ExpressionEngine
*
* Place config.php in your site root
* Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/config.php
* Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/database.php
* If you have moved your site root you'll need to update the require_once path
*
@nifl
nifl / paths
Created June 26, 2014 17:50
Order /etc/paths to give user-installed binaries precedence
# New
/usr/local/bin
/usr/bin
/bin
/usr/local/sbin
/usr/sbin
/sbin
# Default