Skip to content

Instantly share code, notes, and snippets.

@sameg14
sameg14 / apache_vhost.conf
Created August 13, 2015 19:41
Apache symfony virtualhost config
<VirtualHost *:80>
ServerName symfony.vm
ServerAlias symfony.vm
DocumentRoot /var/www/symfony/web
<Directory /var/www/symfony/web>
DirectoryIndex app_dev.php
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
@sameg14
sameg14 / nginx_vhost.conf
Created August 13, 2015 19:44
Symfony vhost nginx config with index.php as the front controller entry point
server {
listen 80;
server_name symfony.vm;
root /usr/share/nginx/html/web;
error_log /var/log/nginx/symfony.error.log;
access_log /var/log/nginx/symfony.access.log;
rewrite ^/index\.php/?(.*)$ /$1 permanent;
@sameg14
sameg14 / index.php
Created August 13, 2015 19:45
Symfony index.php front controller switches on ENVIRONMENT
<?php
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\ClassLoader\ApcClassLoader;
$env = getenv('ENVIRONMENT');
if (!isset($env) || empty($env)) {
die('Please set environment variable in nginx like so: fastcgi_param ENVIRONMENT prod;');
}
{
"name": {
"common": "Austria",
"official": "Republic of Austria",
"native": {
"bar": {
"official": "Republik Österreich",
"common": "Österreich"
}
}
<?php
require('vendor/autoload.php');
require('config.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';
$mail->Host = "smtp.gmail.com";
@sameg14
sameg14 / VagrantFile
Last active March 1, 2018 15:55
vagrant file for symfony.vm
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = "symfony.vm"
config.vm.box = "sameg14/symfony2"
config.vm.network "private_network", ip: "10.10.10.24"
config.vm.synced_folder "symfony2", "/var/www/symfony2"
config.vm.provider "virtualbox" do |vb|

PHPIntro Intermediate Midterm - Part 1

Instructions

Copy this text file to a file named YourName_Midterm_Part1.txt. For example, JoeMcCullough_Midterm_Part1.txt. You will provide your answers to the problems in the "Answer:" sections indicated.

@sameg14
sameg14 / sample user coupons response.json
Created February 3, 2016 18:47
sample user coupons response
[
{
"redeemed":false,
"id":"a02F000000ONRThIAP",
"title":"House-Made Guacamole",
"sub_title":"$2 Off",
"offer_description":"any ONE (1) tub House-Made Guacamole",
"mobile_web_info":"",
"terms_and_conditions":"Save $2 when you buy any one (1) tub House-Made Guacamole. Coupon good one time only. Valid 2/3/2016\u20132/9/2016 in participating U.S. Whole Foods Market\u00ae stores only. Valid customer barcode must be presented at checkout. Coupon valid for all sizes and varieties. Product selection and availability varies by location. Offer will be applied at checkout during the qualifying shop. No rain checks. Cannot be combined with any other offer or applied to previous orders. Void where prohibited.",
"start_date":"2016-02-03T00:00:00.000Z",
{
"365.generic":[
{
"365_affinity":"bool"
},
{
"365_insight":"bool"
}
],
"esp.generic":[