Skip to content

Instantly share code, notes, and snippets.

@mtimbs
mtimbs / SQSRecordFactory.ts
Created March 11, 2020 00:32
Utility for generating fake SQS Records to help with Unit/Integration testing
import { v4 as uuidv4 } from 'uuid';
import { SQSRecord } from 'aws-lambda';
const now = Math.round((new Date()).getTime() / 1000).toString();
export default (params?: Partial<SQSRecord>): SQSRecord => ({
messageId: uuidv4(),
receiptHandle: uuidv4(),
body: '',
@Ocramius
Ocramius / .gitignore
Last active July 22, 2017 15:20
PissOff: a valid, polite and useful alternative to the `void` return type in PHP
vendor
composer.lock
@mnapoli
mnapoli / gist:7428000
Created November 12, 2013 09:25 — forked from incredimike/config.inc.php
Default phpMyAdmin configuration for exports.
<?php
# Add the following to /etc/phpmyadmin/conf.d/export.inc.php
$cfg['Export']['sql_drop_database'] = true;
$cfg['Export']['sql_drop_table'] = true;
$cfg['Export']['compression'] = 'zip';
$cfg['Export']['sql_disable_fk'] = true;
$cfg['Export']['sql_use_transaction'] = true;
@mnapoli
mnapoli / DI containers summary.md
Last active May 7, 2018 07:58
DI containers usage comparison
@mnapoli
mnapoli / behat-reference.feature
Last active February 12, 2024 10:54
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import time
import sys
ua = 'Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1'
referer = 'http://www.lequipe.fr/Tennis/Directs'
@mnapoli
mnapoli / DI-Configuration.md
Last active December 15, 2015 06:19
PHP-DI alternative configuration options

Reflections on PHP-DI configuration.

Currently, the configuration is in PHP or annotations, PHP config has the following advantages:

  • PHP developpers know PHP
  • IDE autocompletion/error detection
  • Bean definition using closures

Disadvantages of PHP:

@mnapoli
mnapoli / php-hotkey.ahk
Created October 17, 2012 08:46
Autohotkey script for PHP developers on the BÉPO layout
; PHP developer shortcuts for BÉPO keyboard layouts
; Need AutoHotkey_L to support unicode encoding (http://www.autohotkey.com/download/)
; "->" for PHP (when typing <Alt>+8)
!-::
Send ->
return
@mnapoli
mnapoli / reference.yml
Last active January 12, 2023 00:08
Doctrine YAML configuration reference
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html
MyEntity:
type: entity
repositoryClass: MyRepositoryClass
table: my_entity
namedQueries:
all: "SELECT u FROM __CLASS__ u"
# Class-Table-Inheritance
@raphaelstolt
raphaelstolt / php54_php53_pear_macports.markdown
Created May 17, 2012 21:37
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules