Skip to content

Instantly share code, notes, and snippets.

View bocharsky-bw's full-sized avatar
💔
#StandWithUkraine 🇺🇦

Victor Bocharsky bocharsky-bw

💔
#StandWithUkraine 🇺🇦
View GitHub Profile
@plfort
plfort / webpack.config.js
Created January 5, 2018 08:22
Symfony Encore trick for completion in PHPStorm (Can't analyse webpack.config.js)
...
let config = Encore.getWebpackConfig();
if(!Encore.isProduction()) {
fs.writeFile("fakewebpack.config.js", "module.exports = "+JSON.stringify(config), function(err) {
if(err) {
return console.log(err);
}
console.log("fakewebpack.config.js written");
});
}
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
FROM ubuntu:16.04
RUN PACKAGES="\
php-cli \
php-mysql \
php-intl \
php-xml \
php-curl \
php-dom \
" && \
@akovalyov
akovalyov / File.orm.yml
Created May 18, 2015 08:12
Pure file upload with Doctrine entity listener, doctrine events and symfony2 dependency injection
App\Model\File:
type: entity
table: files
entityListeners:
App\Doctrine\EventListener\FileUploadListener:
prePersist: [upload]
preUpdate: [upload]
preRemove: [remove]
id:
id:
@weaverryan
weaverryan / ApiTestCase.php
Last active September 23, 2019 15:22
Example Symfony ApiTestCase (from WIP KnpUniversity Symfony REST tutorial)
<?php
namespace AppBundle\Tests\Controller\Api;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
use Doctrine\ORM\EntityManager;
use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Message\ResponseInterface;
use GuzzleHttp\Subscriber\History;
@olalonde
olalonde / boot2docker-use-nfs.sh
Last active December 4, 2023 12:07
Script to mount /Users with nfs instead of vboxsf in boot2docker
#!/bin/bash
#
# This script will mount /Users in the boot2docker VM using NFS (instead of the
# default vboxsf). It's probably not a good idea to run it while there are
# Docker containers running in boot2docker.
#
# Usage: sudo ./boot2docker-use-nfs.sh
#
@md5
md5 / 00_README.md
Last active March 20, 2024 00:19
Demonstration Docker config for Wordpress on PHP-FPM behind Nginx

Proof of concept setup for Wordpress running under PHP-FPM with an Nginx frontend

Usage

Build a copy of this image:

git clone git://github.com/d9206eacb5a0ff5d6be0.git docker-nginx-fpm
cd docker-nginx-fpm
docker build -t nginx-fpm .
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
<?php
$sites = "http://www.broadcastsolutions.com.au/
http://www.kvm.com.au/
http://www.ambertech.com.au/";
$sites = preg_split('/\r\n|\r|\n/', $sites);
echo "