Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am domdoescode on github.
  • I am domdoescode (https://keybase.io/domdoescode) on keybase.
  • I have a public key ASBU2Tljs4PEAcU1l_UNdENFfmrO7Oa2t3RWOJtpiE-CUAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am domudall on github.
  • I am domudall (https://keybase.io/domudall) on keybase.
  • I have a public key ASBMUap5KrWtZMtVZ0OMiCzp3QsPSu4JVWOqX-dO_mDpZgo

To claim this, I am signing this object:

@domdoescode
domdoescode / gist:afb228fee3ea80f8f594
Last active August 29, 2015 14:01
Sunday World Handover

Watermarking

The work within admin has been completed on this in the feature/watermarked-images branch, however there was one area that needed some consideration.

For the images to be watermarked on the front end, a new endpoint in darkroom-api is required. This endpoint would also be required so that permanently watermarking an image would replace the existing image with a watermarked one.

Cxense

They have provided code which has been styled themselves, which is currently within master as an admin widget cxenseRecommended. I've been in contact with Andy Kelly (andykellydk on Skype) regarding next steps, which is allowing them to index the whole site, and also them creating another widget for the site. I can make an introduction via email, Andy is the best person to discuss next steps with.

@domdoescode
domdoescode / request.test.js
Created March 12, 2014 12:38
Request test
request(
{ url: 'http://google.co.uk'
, method: 'GET'
}, function (error, response, body) {
if (error) {
logger.error(error)
return callback(error)
}
// Do some things
@domdoescode
domdoescode / one.js
Created November 19, 2013 14:59
Which is better and why?
module.exports = function () {
function myFunction(callback) {
return callback()
}
return {
myFunction: myFunction
}
}
@domdoescode
domdoescode / asmr.md
Last active December 22, 2015 23:59
App/Server Monitoring Requirements

App/Server Monitoring Requirements

One issue we're having at the moment is analysing traffic for various virtual hosts (in both Apache and Nginx). A combination of scripting and munin has proven OK, but not ideal. As we're on a cloud infrastructure, working out where traffic is coming from and what specifically is causing it is key.

Our alert and support processes are also currently being reworked; insight into server metrics is useful, and alerts based specifically on certain criteria is a must. Nagios has proven useful for alerts but the overheads in setting it up for each server/service is too much for our small team.

A dream scenario would be a dashboard of servers and services with a basic view of status (OK, warning, critical) that we can have in our office

The main problem we have is setting this infrastructure up; although most of this is achievable, we're looking for any SaaS that can provide this level of insight out of the box. Possibly a pipe-dream, but worth asking around!

{
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"default_line_ending": "unix",
"dictionary": "Packages/Language - English/en_GB.dic",
"flatland_square_tabs": true,
"font_size": 8,
"highlight_modified_tabs": true,
"ignored_packages":
[
],
@domdoescode
domdoescode / new_gist_file
Created June 17, 2013 17:45
Clock Development Setup - Mac OsX
# Stop if something fails
set -e
# Install the latest stable nave the node.js environment switcher Node.js
sudo sh -c 'curl -fsSL https://raw.github.com/isaacs/nave/master/nave.sh > /usr/local/bin/nave && chmod ugo+x /usr/local/bin/nave'
# Install a global node.js
nave usemain stable
# Is xcode needed?
if i % 2 === 0
- var liClass = 'grid.grid--slim'
else
- var liClass = 'grid.grid--slim grid--reversed'
@domdoescode
domdoescode / mobile.php
Created November 12, 2012 13:31
Stupidly basic mobile detection =\
<?php
$mobileType = new stdClass();
//Detect special conditions devices
$mobileType->iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$mobileType->iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$mobileType->iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
if(stripos($_SERVER['HTTP_USER_AGENT'],"Android") && stripos($_SERVER['HTTP_USER_AGENT'],"mobile")) {
$mobileType->android = true;
} elseif (stripos($_SERVER['HTTP_USER_AGENT'],"Android")){
$mobileType->android = false;