Skip to content

Instantly share code, notes, and snippets.

@djandyr
djandyr / commit-message-guidelines.md
Last active April 24, 2019 14:10
Commit Message Guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages

Interface

Objects define their behavior with the outside world through the methods that they expose. These methods form the object’s interface, when implementing an interface the class formally promises to provide behaviour. If your class implements an interface, all methods defined by that interface must appear in your class before it can be successfully ran.

Imagine your in a empty room, then a zombie attacks - you have no weapon. Luckily a fellow human is standing at the door, you shout "Quick throw me something I can bash this zombie with!". Thinking about this situation you need a weapon which has the following behaviour:

  • Throwable (you dont want to be thrown a 20kg chainsaw)
  • Lethal (you dont want a soft toy)
@djandyr
djandyr / gist:783d404b9028c6d837bb
Last active August 29, 2015 14:23
Elastic Beanstalk OSX

Installing Elastic Beanstalk Command Line Interface on MacOSX.

Install Python 2.7 from homebrew, make sure openssl is installed first (otherwise you will get errors with the importing hashlib).

brew install openssl
brew link openssl --force
brew install python --with-brewed-openssl
brew link python --force
@djandyr
djandyr / gist:3c083bd1790aeecd1c9e
Last active May 16, 2024 19:05
XAMPP Automatically start Apache (MacOS)

Automatically start XAMPP Apache when logging into MacOSX.

  1. Create xampp.startapache.plist in /Library/LaunchDaemons with the following content :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@djandyr
djandyr / gist:86b811d770fabc756645
Last active August 29, 2015 14:20
Fix Symfony Permission in XAMPP
rm -rf app/cache/*
rm -rf app/logs/*
# Make sure the HTTPDUSER is correct
# egrep -iw 'user' /Applications/XAMPP/etc/httpd.conf
HTTPDUSER=daemon
sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
@djandyr
djandyr / gist:d3901a5539862b622568
Last active December 10, 2016 15:54
Composer SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (PHP 5.6, MacOSX)

When using composer, the following error is displayed :

[Composer\Downloader\TransportException]                                                                                       
The "https://getcomposer.org/version" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:  
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed                                              
Failed to enable crypto                                                                                                        
failed to open stream: operation failed 
@djandyr
djandyr / gist:c04950a1375e96814316
Last active June 3, 2024 10:50
MacOS XAMPP PHP Installation

Change default Mac OS X PHP to XAMPP's PHP Installation and Install Composer


Find out what version of PHP is running

which php

This will output the path to the default PHP install which comes preinstalled by Mac OS X, by default

@djandyr
djandyr / cli-config.php
Last active August 29, 2015 14:04
Skipper18: Generate Getters and Setters
<?php
require_once "vendor/autoload.php";
// The path to your entities generated by skipper18
$entityPath = array(__DIR__."/Entities");
$config = Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration($entityPath, true);
$config->setMetadataDriverImpl(
new Doctrine\ORM\Mapping\Driver\AnnotationDriver(
new Doctrine\Common\Annotations\CachedReader(