Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
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
module.exports = (function(){ | |
const MS = | |
{ seconds: 1000 | |
, minutes: 60 * 1000 | |
, hours: 60 * 60 * 1000 | |
, days: 24 * 60 * 60 * 1000 | |
, weeks: 7 * 24 * 60 * 60 * 1000 | |
, months: 30 * 7 * 24 * 60 * 60 * 1000 | |
, years: 365 * 24 * 60 * 60 * 1000 } |
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
// Mobile Safari in standalone mode | |
if(("standalone" in window.navigator) && window.navigator.standalone){ | |
window.addEventListener("load",function() { | |
links = document.getElementsByTagName('a'); | |
for (var i=0; i < links.length; i++) | |
{ | |
// Don't do this for javascript: links |
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
setInterval((function fn () { | |
console.log(new Date()); // run some arbitrary code | |
return fn; // here be the magic | |
}()), 1000); | |
// ^---- and that runs the function, and the return val is assign to the interval |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Responsive Design Testing</title> | |
<style> | |
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; } | |
.wrapper { width: 6000px; } | |
.frame { float: left; } | |
h2 { margin: 0 0 5px 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
_ = require('underscore') | |
RendrBase = require('rendr/shared/base/model') | |
module.exports = class Base extends RendrBase | |
constructor: -> | |
super | |
@initRelations() | |
initRelations: -> | |
return unless @relations? |
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 rendrMw = require('rendr/server/middleware') | |
, _ = require('underscore') | |
; | |
module.exports = function(dataAdapter, method, options) { | |
return function(req, res, next) { | |
if (req.path !== options.appPath && req.method !== method.toLowerCase()) return; | |
res.format({ | |
json: function() { |