Skip to content

Instantly share code, notes, and snippets.

View phpfour's full-sized avatar

Mohammad Emran phpfour

View GitHub Profile
backend default {
.host = "127.0.0.1";
.port = "80";
}
sub vcl_recv {
if (req.http.Cache-Control ~ "no-cache") {
return (pass);
}

New computer setup

  • a/o 2015-05-27 *

Format the drive

  1. Restart with cmd-R or cmd-D
  2. Erase drive / 3x if second-handk
  3. Reinstall MacOS
<?php
class ActivitiService{
const BASE_URL = 'http://localhost:8080/activiti-rest/service/';
const ADMIN_USERNAME = 'kermit';
private $_services = array(
'processDefinitions' => 'process-definitions',
'processDefinition' => 'process-definition/',
#!/bin/bash
sudo apt-get remove phantomjs
sudo unlink /usr/local/bin/phantomjs
sudo unlink /usr/local/share/phantomjs
sudo unlink /usr/bin/phantomjs
sudo apt-get install fontconfig
sudo su -
# stuff we need to build from source
apt-get install libpcre3-dev build-essential libssl-dev libssl0.9.8 zlib1g lsb-base
# get the nginx source
cd /opt/
wget http://nginx.org/download/nginx-1.4.4.tar.gz
tar -zxvf nginx*
@phpfour
phpfour / default.vcl
Created January 15, 2016 03:37 — forked from reifman/default.vcl
Example Varnish VCL Configuration e.g. /etc/varnish/default.vcl
# Default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 60s;
.first_byte_timeout = 60s;
.between_bytes_timeout = 60s;
.max_connections = 800;
}
@phpfour
phpfour / OracleDoctrineTypeMappingListener.php
Created January 23, 2016 02:41 — forked from johnkary/OracleDoctrineTypeMappingListener.php
Connecting to Oracle with Symfony2 and Doctrine 2. 1. Map Oracle's DATE type to Doctrine's "date" type instead of "datetime" for Oracle driver. 2. Properly configures Doctrine to use most common Oracle Date and DateTime environment configurations. You may or may not need this. Check your Oracle server configuration and see \Doctrine\DBAL\Event\L…
<?php
namespace Acme\PeopleSoftBundle\Listener;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;
use Doctrine\Common\EventSubscriber;
/**
* Changes Doctrine's default Oracle-specific column type mapping to Doctrine
@phpfour
phpfour / macosx-install-php-oracle-oci8.md
Last active January 8, 2017 11:45 — forked from gido/macosx-install-php-oracle-oci8.md
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8
@phpfour
phpfour / gist:00b62511c0dc6f9ea36b2c0d98dfa5ed
Created July 21, 2017 15:48 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@phpfour
phpfour / macosx-install-php-oracle-oci8-pdo_oci.md
Created October 14, 2017 10:44 — forked from fhferreira/macosx-install-php-oracle-oci8-pdo_oci.md
Install OCI8 and / or PDO_OCI on OSX via Brew

Installation

This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).

PHP 5.6 installed with Homebrew.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):