Skip to content

Instantly share code, notes, and snippets.

View jonsherrard's full-sized avatar
💭
Working

Jon Sherrard jonsherrard

💭
Working
View GitHub Profile
@jonsherrard
jonsherrard / static.js
Last active August 29, 2015 13:57 — forked from appleton/static.js
app.use(function(req, res, next) {
if(req.url.indexOf("js/") === 0) {
res.setHeader("Cache-Control", "public, max-age=345600");
}
if(req.url.indexOf("js/") === 0) {
res.setHeader("Cache-Control", "public, max-age=172800");
}
return next();
});
app.use(express.static(path.join(__dirname, 'www')));
@jonsherrard
jonsherrard / active_game.php
Created October 8, 2012 15:11 — forked from benhartley/active_game.php
active_game.php
<?
$this->facebook_id = $facebook_id;
$active_game = array_filter($games, function($game) {
return $game->active;
});
/*
# Not sure this is needed, the game with the lowest game_id should be returned.
if (count($active_game) > 1):
@jonsherrard
jonsherrard / active_game.php
Created October 8, 2012 15:08 — forked from benhartley/active_game.php
active_game.php
<?
$this->facebook_id = $facebook_id;
$active_game = array_filter($games, function($game) {
return $game->active;
});
/*
# Not sure this is needed, the game with the lowest game_id should be returned.
if (count($active_game) > 1):