Instantly share code, notes, and snippets.

Jérémy Barbe CapMousse

View GitHub Profile
View mongoose-autoconnect.js
const mongoose = require('mongoose')
const dbURL = process.env.MONGODB_ADDON_URI
mongoose.Promise = global.Promise
mongoose.set('debug', process.env.NODE_ENV !== "production")
const db = mongoose.createConnection(dbURL)
const reconnect = _ => {
setTimeout(_ => {
console.info('Retrying DB connection')
@CapMousse
CapMousse / gist:3448803
Created Aug 24, 2012
Detect CMYK images with php
View gist:3448803
<?php
$infos = getimagesize($image);
if ($infos['channels'] ==4) {
echo 'CMYK';
} else {
echo 'RGB':
}
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 JEREMY BARBE http://www.shwaark.com
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 JEREMY BARBE http://www.shwaark.com
THANK TO subzey FOR HELP
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.