Skip to content

Instantly share code, notes, and snippets.

View theofidry's full-sized avatar
🌴

Théo FIDRY theofidry

🌴
View GitHub Profile
@jakzal
jakzal / drun.sh
Last active July 19, 2016 13:07
Run an aliased or a regular command on a docker container
#!/bin/bash
set -e
set -u
set -o pipefail
CONTAINER_OR_ALIAS=${1:-""}
COMMAND=${2:-""}
ARGUMENTS="${@:3}"
@jeroenvdgulik
jeroenvdgulik / Talklist.md
Last active December 17, 2023 19:04
My mostly incomplete list of memorable talks that should probably be required material

The list is now hosted on a repository so you can PR -> https://github.com/jeroenvdgulik/awesome-talks/blob/master/README.md

The list

@sroze
sroze / MyCommand.php
Last active June 6, 2021 13:58
Symfony Command that read file from file name or STDIN
<?php
namespace AmceBundle\Command;
class MyCommand
{
// ...
protected function execute(InputInterface $input, OutputInterface $output)
{
@michellesanver
michellesanver / socials.md
Last active November 19, 2015 16:28
Conference socials in bars: How culture doesn't match comfort

I was hesitant as to whether or not to publish this, but in an act to create awareness in a community where some people, including me, are left uncomfortable and no one notices, I decided to go ahead. Feel free to share your experiences too, to further spread awareness in our community, because awareness is the first step.

I noticed that I started being more and more reserved the more events I went to rather than the other way around. This worried me and I was up until late hours thinking, why is that?

What happens at the events may be part of that, so here I'm sharing to create awareness. Bear in mind that this is only a handful of things that happened to me at conference socials, to give you an idea as to why I'm nowadays inclined to only hangout with the people I know, or skip the conference socials all together.

When you notice that behaviour from me remember that: It's not you, it's me, feel free to say hi but please understand why I may be a bit shy at first.

Disclaimer: I didn’t repor

What's the difference between cascade="remove" and orphanRemoval=true in Doctrine 2

TLDR: The cascade={"remove"} is like a "software" onDelete="CASCADE", and will remove objects from the database only when an explicit call to $em->remove() occurs. Thus, it could result in more than one object being deleted. orphanRemoval can remove objects from the database even if there was no explicit call to ->remove().

I answered this question a few times to different people so I will try to sum things up in this Gist.

Let's take two entities A and B as an example. I will use a OneToOne relationship in this example but it works exactly the same with OneToMany relationships.

class A
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@klovadis
klovadis / gist:2549131
Created April 29, 2012 10:03
How to use optional arguments in node.js
// example function where arguments 2 and 3 are optional
function example( err, optionalA, optionalB, callback ) {
// retrieve arguments as array
var args = [];
for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
// first argument is the error object