- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
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
CREATE TABLE accounts( | |
id serial PRIMARY KEY, | |
name VARCHAR(256) NOT NULL | |
); | |
CREATE TABLE entries( | |
id serial PRIMARY KEY, | |
description VARCHAR(1024) NOT NULL, | |
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
-- Every entry is a credit to one account... |
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 path = require('path'); | |
var express = require('express'); | |
var webpack = require('webpack'); | |
var config = require('./webpack.config.dev'); | |
var fs = require('fs'); | |
var app = express(); | |
var compiler = webpack(config); | |
app.use(require('webpack-dev-middleware')(compiler, { |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
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
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
}; | |
NodeList.prototype.__proto__ = Array.prototype; |
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 ParallaxManager, ParallaxPart; | |
ParallaxPart = (function() { | |
function ParallaxPart(el) { | |
this.el = el; | |
this.speed = parseFloat(this.el.getAttribute('data-parallax-speed')); | |
this.maxScroll = parseInt(this.el.getAttribute('data-max-scroll')); | |
} | |
ParallaxPart.prototype.update = function(scrollY) { |
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 options, paths, | |
gulp = require("gulp"), | |
merge = require("merge-stream"), | |
path = require("path"), | |
clean = require("gulp-clean"), | |
concat = require("gulp-concat"), | |
markdown = require("gulp-markdown"), | |
minifyCSS = require("gulp-minify-css"), | |
removeLines = require("gulp-remove-lines"), |
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
// code via http://scotch.io/quick-tips/all-search-and-social-media-meta-tags-starter-template | |
#Search Engines / Google | |
<!-- SEO --> | |
<meta name="author" content="Author name here...."> | |
<meta name="description" content="Description text here....."> | |
<link rel="canonical" href="URL here..."> <!-- info: http://goo.gl/0ta7jy --> | |
#Twitter Cards (Large Image) | |
<!-- Social: Twitter --> |
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
/* | |
|-------------------------------------------------------------------------- | |
| Browser-sync config file | |
|-------------------------------------------------------------------------- | |
| | |
| Please report any issues you encounter: | |
| https://github.com/shakyShane/browser-sync/issues | |
| | |
| For up-to-date information about the options: | |
| https://github.com/shakyShane/browser-sync/wiki/Working-with-a-Config-File |
NewerOlder