Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am por on github.
  • I am por (https://keybase.io/por) on keybase.
  • I have a public key ASCq6KiIHahvz1TzopPTXHQ3J3rc-3RQLLAlUNy-TYkyZAo

To claim this, I am signing this object:

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
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() {
_ = require('underscore')
RendrBase = require('rendr/shared/base/model')
module.exports = class Base extends RendrBase
constructor: ->
super
@initRelations()
initRelations: ->
return unless @relations?
@por
por / css.ini
Created May 8, 2012 10:08
CSS Safe Defaults
; Sources:
; http://reference.sitepoint.com/css
; http://developer.mozilla.org/en/CSS
animation = "none"
animation-delay = "0"
animation-direction = "normal"
animation-duration = "0"
animation-fill-mode = "none"
animation-iteration-count = "1"
@por
por / responsive.html
Created January 28, 2012 14:04 — forked from lensco/responsive.html
Simple responsive design test page. More info here: http://bricss.net/post/16538278376/simple-responsive-design-test-page
<!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; }
@por
por / gist:1372858
Created November 17, 2011 10:22 — forked from remy/gist:360113
setInterval run once, then keep running
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
@por
por / stay_standalone.js
Created June 23, 2011 09:23 — forked from kylebarrow/example.html
Prevent links in standalone web apps opening Mobile Safari
// 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
@por
por / ago.js
Created June 2, 2011 21:03 — forked from gf3/ago.js
Super small relative dates
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 }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="refresh" content="3600" />
<title>Scrobble Map</title>
<link rel="stylesheet" href="scrobblemap.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>