Skip to content

Instantly share code, notes, and snippets.

@guiliredu
guiliredu / .editorconfig
Created March 7, 2019 23:25
Editorconfig for PHP PSR-4
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# All PHP files MUST use the Unix LF (linefeed) line ending.
# Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting.
# All PHP files MUST end with a single blank line.
# There MUST NOT be trailing whitespace at the end of non-blank lines.
[*]
@labbots
labbots / SwitchPhp.sh
Last active April 5, 2023 18:01
Bash script to switch between available PHP versions in Ubuntu. (Tested in Ubuntu 16.04)
#!/bin/bash
# Check if ran with root permissions
if [ `id -u` -ne 0 ]; then
printf "The script must be run as root! (you can use sudo)\n"
exit 1
fi
function arrayContains {
local e match="$1"
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active May 25, 2024 06:37
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@yoga-
yoga- / randomPassword.php
Last active September 15, 2023 19:37
PHP random password generator - contains at least one lower case letter, one upper case letter, one number and one special character,
//generates a random password of length minimum 8
//contains at least one lower case letter, one upper case letter,
// one number and one special character,
//not including ambiguous characters like iIl|1 0oO
function randomPassword($len = 8) {
//enforce min length 8
if($len < 8)
$len = 8;
@nateevans
nateevans / MenuBuilder.php
Created April 3, 2014 16:56
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (see http://bit.ly/1sd1rJr , thanks to Niels Mouthaan!)
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)