Skip to content

Instantly share code, notes, and snippets.

@nicoavila
nicoavila / docker-compose.yml
Last active March 7, 2024 12:30
Docker Compose file for a MySQL 5.7 container
version: '3.3'
services:
database:
image: mysql:5.7
container_name: mysql
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
@juampynr
juampynr / guzzle_post.php
Last active May 1, 2023 19:52
Sample POST request with Guzzle
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client([
'base_uri' => 'http://example.com',
]);
@niksumeiko
niksumeiko / disable-html-form-input-autocomplete-autofill.md
Last active June 18, 2024 05:15
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@Ocramius
Ocramius / quick-doctrine-orm-zf2-sql-logging.local.php
Last active October 19, 2021 05:48
SQL Logger in Doctrine 2 ORM and ZF2
<?php
use Zend\ServiceManager\ServiceLocatorInterface;
return [
'service_manager' => [
'delegator' => [
'doctrine.entitymanager.orm_default' => [
function (ServiceLocatorInterface $sl, $name, $requestedName, $callback) {
/* @var $em \Doctrine\ORM\EntityManager */
@adrienbrault
adrienbrault / guzzle.php
Created April 8, 2013 16:40
Download a file using guzzle
<?php
$client = ...;
$response = $client->get('http://guzzlephp.org/index.html', null, tmpfile())->send();
$response->getStream(); // Magic comes after