Skip to content

Instantly share code, notes, and snippets.

View JCook21's full-sized avatar

Jeremy Cook JCook21

  • Guelph, Ontario
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jcook21 on github.
  • I am jcook21 (https://keybase.io/jcook21) on keybase.
  • I have a public key ASAtZRgy6BfC2xcJ24_T4po4vhoqBjFk58vOThiLhXL96Qo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am JCook21 on github.
  • I am jcook21 (https://keybase.io/jcook21) on keybase.
  • I have a public key whose fingerprint is D16C CD72 919C F58B E048 66D1 F990 F128 4E33 1FF9

To claim this, I am signing this object:

@JCook21
JCook21 / gist:6545828
Created September 13, 2013 01:12
Abstract for a talk entitled 'Turbo charge your logs'.
The log files our applications produce contain a wealth of information about how things are performing at any moment, yet for many of us the only time we look at them is when our we're trying to diagnose problems during an outage. Wouldn't it be great if our log files could be mined in real time and even alert us before things get to a critical state? This talk will show you exactly how to do that using open source tools. We'll look at using software such as Monolog and Rsyslog to collect information from individual servers as well as Graylog2 to aggregate, store and make quickly searchable millions of log records from multiple sources. By the end of this talk you'll have the knowledge required to mine your log data in real time, helping you to avoid major problems.
@JCook21
JCook21 / gist:6545818
Created September 13, 2013 01:10
Abstract for a talk titled 'Accelerate your web app with a layer of Varnish'
Can your web app quickly scale to handle massive fluctuations in traffic? How about stay up during a DDOS attack? Can it do either of these while maintaining a lightning fast response time and without breaking the bank? The Varnish web application accelerator is a tool that can help you to achieve all of these things. This talk will introduce what Varnish is and when it's the right tool for the job. We'll examine how you can install and configure it to sit in front of any HTTP server to act as a reverse proxy, serving cached content at very high speeds. We'll then examine the Varnish configuration language and how you can use it fine tune every aspect of Varnish's performance as well as Varnish's support for edge side includes, allowing you to cache different content on the same page for varying amounts of time. We'll finish with a quick rundown of the tools Varnish provides to monitor and further tweak its configuration. By the end of this talk you should have the knowledge needed to get started with Varnish
@JCook21
JCook21 / gist:5117548
Last active December 14, 2015 16:48
Testing using timers for data imports.
<?php
require dirname(__DIR__) . '/vendor/autoload.php';
class Test
public function putBioAction(Team $team, TeamMember $teamMember, MemberBio $bio, Request $request)
{
if (! self::validateTeamMemberForTeam($team, $teamMember) || $bio->getTeamMember() !== $teamMember) {
throw $this->createNotFoundException('Invalid team member for team or bio for team member');
}
@JCook21
JCook21 / gist:4527290
Created January 14, 2013 02:10
Vim config setup to allow the gf command to work with namespaced PHP classes.
" Allow gf to work with PHP namespaced classes.
set includeexpr=substitute(v:fname,'\\\','/','g')
set suffixesadd+=.php
@JCook21
JCook21 / gist:4527261
Created January 14, 2013 01:56
Quick demo of vim path settings for a local project.
set path+=/path/to/project/src/**
set path+=/path/to/project/vendor/**
@JCook21
JCook21 / deploy.rb
Created November 11, 2012 18:29
Sample Capifony Deployment script
# Deployment server info
set :application, "APP NAME"
set :domain, "APP DOMAIN NAME"
set :deploy_to, "/path/on/live/server"
set :app_path, "app"
set :web_path, "web"
set :maintenance_basename, "maintenance"
# SCM info
set :repository, "GIT REMOTE REPO URL"
@JCook21
JCook21 / gist:3824584
Created October 3, 2012 02:26
Error handling file to log all PHP errors to Graylog2
<?php
/**
* This file sets up exception and error handlers to log errors to our Graylog2
* server.
*
* @author Jeremy Cook
*/
//Add the autoloader generated by composer for dependencies.
require_once 'path/to/composer/autoload.php';