Skip to content

Instantly share code, notes, and snippets.

View OskarStark's full-sized avatar
🏠
Symfony ❣️ Sonata

Oskar Stark OskarStark

🏠
Symfony ❣️ Sonata
View GitHub Profile
@heiglandreas
heiglandreas / ldap.php
Last active November 11, 2021 20:02
Disable Certificate-check for LDAPS/ldap_tls
<?php
$con = ldap_connect('ldaps://ldap.example.com');
ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($con, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_NEVER);
/*
Possible values:
LDAP_OPT_X_TLS_NEVER
This is the default. slapd will not ask the client for a certificate.
@rponte
rponte / get-latest-tag-on-git.sh
Last active March 11, 2024 07:50
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@gnutix
gnutix / DoctrineDbalStatementInterface.php
Created December 2, 2013 09:07
Mock Builder for Doctrine EntityManager / Connection mock objects.
<?php
namespace Mocks;
use Doctrine\DBAL\Driver\Statement;
/**
* Doctrine DBAL Statement implementing \Iterator.
*
* This class has been created because of a bug in PHPUnit Mock Objects.
@K-Phoen
K-Phoen / config.yml
Created December 18, 2012 11:22
Storing Symfony2 sessions in memcached
imports:
# ....
- { resource: services/session.yml }
framework:
# ....
session:
handler_id: session.handler.memcached
@leon
leon / nginx.conf
Created June 29, 2012 16:34
Nginx PHP-FPM Symfony 2 minimal config
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {