Skip to content

Instantly share code, notes, and snippets.

View flopywood's full-sized avatar

Florencia De Vuono flopywood

  • Buenos Aires, Argentina
View GitHub Profile
@primaryobjects
primaryobjects / error.js
Last active June 19, 2021 08:13
Redirect 404 errors to a static web page in node.js Express.
var fs = require('fs');
// In your app.js, include a route handler for all other routes (*) to go to error404.
// app.get('*', error.error404);
exports.error404 = function(req, res) {
if (req.accepts('html')) {
// Respond with html page.
fs.readFile(__dirname + '/../../public/404/index.html', 'utf-8', function(err, page) {
res.writeHead(404, {'Content-Type': 'text/html'});
res.write(page);
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………