# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
# We need to tap homebrew-dupes because "homebrew-apache/httpd22" relies on "homebrew-dupes/zlib"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Laravel</title> | |
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"> | |
<style> | |
html, body { | |
height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Recursively takes the specified criteria and adds too the expression. | |
* | |
* The criteria is defined in an array notation where each item in the list | |
* represents a comparison <fieldName, operator, value>. The operator maps to | |
* comparison methods located in ExpressionBuilder. The key in the array can | |
* be used to identify grouping of comparisons. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# src/Acme/DemoBundle/Security/Authentication/Handler/LoginSuccessHandler.php | |
<?php | |
namespace Acme\DemoBundle\Security\Authentication\Handler; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\Routing\Router; | |
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; | |
use Symfony\Component\Security\Core\SecurityContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/Desktop/ssl | |
cd ~/Desktop/ssl | |
openssl genrsa -des3 -out server.key 1024 | |
openssl req -new -key server.key -out server.csr | |
cp server.key server.key.org | |
openssl rsa -in server.key.org -out server.key | |
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt | |
sudo cp server.crt /private/etc/apache2/server.crt | |
sudo cp server.key /private/etc/apache2/server.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Foo\CoreBundle\Form\EventListener; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Symfony\Component\Form\FormEvents; | |
use Symfony\Component\Form\FormEvent; | |
use Symfony\Component\Form\FormInterface; | |
/** | |
* Changes Form->bind() behavior so that it treats not set values as if they |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use JMS\DiExtraBundle\Annotation as DI; | |
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; | |
/** @DI\Service */ | |
class QSAListener | |
{ | |
private $blacklist; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# A couple of useful bash one-liners for finding all of the extension hooks in | |
# a given ExpressionEngine installation. Here's what it does: | |
# | |
# 1. Finds all of the native hooks, and any third-party hooks; | |
# 2. Sorts them alphabetically; | |
# 3. Outputs them to STDOUT or a file of your choosing. | |
# | |
# Usage: | |
# CD to the `/system/expressionengine/` directory of your site, and run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* euclidean GCD (feel free to use any other) */ | |
function gcd(a,b) {if(b>a) {temp = a; a = b; b = temp} while(b!=0) {m=a%b; a=b; b=m;} return a;} | |
/* ratio is to get the gcd and divide each component by the gcd, then return a string with the typical colon-separated value */ | |
function ratio(x,y) {c=gcd(x,y); return ""+(x/c)+":"+(y/c)} | |
/* eg: | |
> ratio(320,240) | |
"4:3" | |
> ratio(360,240) |
NewerOlder