Skip to content

Instantly share code, notes, and snippets.

@sameg14
sameg14 / gist:8969563
Created February 13, 2014 04:05
perfect varnish caching for joomla
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "127.0.0.1";
.port = "8000";
}
@sameg14
sameg14 / gist:8994627
Created February 14, 2014 02:11
varnish joomla vcl for joomla support for large post files
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "127.0.0.1";
.port = "8000";
}
@sameg14
sameg14 / gist:bbf762e47da1df85ff52
Last active August 29, 2015 14:12
Platform QA Deploy - Ansible Playbook
---
- hosts : platform-qa-server
su : yes
vars :
hipchat_rooms:
- { token: "a2a1d9143d45feac80d33bf5246247", room: "504774", name: "LIN Digital Engineering" }
pre_tasks:
- name : HipChat - Attempting Deploy...
@sameg14
sameg14 / VagrantFile
Last active August 29, 2015 14:14
Mac - ACA generic LAMP VM VagrantFile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = "aca.vm"
config.vm.box = "https://s3-us-west-2.amazonaws.com/vagrantvmboxes/aca-generic-lamp-packaged.box"
config.vm.network "private_network", ip: "10.10.10.60"
config.vm.synced_folder "~/Desktop/htdocs", "/var/www"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
@sameg14
sameg14 / VagrantFile
Last active August 29, 2015 14:14
Windows - ACA generic LAMP VM
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = "aca.vm"
config.vm.box = "https://s3-us-west-2.amazonaws.com/vagrantvmboxes/aca-generic-lamp-packaged.box"
config.vm.network "private_network", ip: "10.10.10.60"
config.vm.synced_folder "c:\\htdocs", "/var/www"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
@sameg14
sameg14 / auth.php
Created March 4, 2015 22:24
Oauth3
<?php
/**
* Get access token via OAuth2 three legged dance
* @see https://sagedocs.wholelabs.com/wiki/index.php?title=Sage-api/v2/authorize
* @throws Exception
* @return string
* @todo: Doc #experiment
*/
protected function getAccessToken()
@sameg14
sameg14 / gist:10533b9cec72ccbd3a20
Last active August 29, 2015 14:20
Production app.php for Symfony2 using ApcClassLoader
<?php
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\ClassLoader\ApcClassLoader;
$loader = require(__DIR__ . '/../app/bootstrap.php.cache');
require(__DIR__ . '/../app/AppKernel.php');
require(__DIR__ . '/../app/AppCache.php');
@sameg14
sameg14 / 7815696ecbf1c96e6894b779456d330e.md
Last active August 29, 2015 14:21
7815696ecbf1c96e6894b779456d330e

Switching an API from node using express to PHP using Symfony

Preamble

We intend to write an article that technically outlines the way Whole Foods Market employs Symfony2 to create a scalable, available and maintainable codebase for our API. The intention is to not endorse any specific vendor, but to outline specific architectural choices we made from an application and infrastructure perspective. Since this is a technical article, we will need to support the ideas under discussion by providing code samples. Code we release will not divulge any trade secrets or compromise the security of our application in any way. All technical teams will be presented this article, in its entirety, and have the opportunity to modify, review and comment on it prior to publishing.

@sameg14
sameg14 / passbook_json_data.json
Created June 16, 2015 19:20
Test passbook json data
{
"formatVersion": 1,
"passTypeIdentifier": "pass.com.accenture.wfm.affinity",
"serialNumber": "p69f2J",
"teamIdentifier": "YJ9R4XZ4CL",
"webServiceURL": "https://example.com/passes/",
"authenticationToken": "vxwxd7J8AlNNFPS8k0a0FfUFtq0ewzFdc",
"locations": [
{
"longitude": -122.3748889,
@sameg14
sameg14 / .htaccess
Created August 13, 2015 19:40
Symfony app_dev.php htaccess file
DirectoryIndex app_dev.php
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]