Skip to content

Instantly share code, notes, and snippets.

@stefanorossiti
stefanorossiti / ldap.php
Created September 25, 2018 06:59
LDAP/AD user validation chech example with PHP LDAP plugin
<?php
$ldaphost = "localhost";
$ldabindDN = "cn=admin,dc=local,dc=test";
$ldapassw = "edpplc";
$ldapport = 389;
$ldap = ldap_connect($ldaphost, $ldapport) or die("Could not connect to $ldaphost");
echo 'Connecting to ' . $ldaphost . '...';
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@stefanorossiti
stefanorossiti / ext.txt
Created April 13, 2018 06:51 — forked from chronon/ext.txt
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@stefanorossiti
stefanorossiti / ajax.js
Created November 15, 2017 09:24 — forked from jasonhinkle/ajax.js
jQuery AJAX Snippet
$.ajax({
url: 'api/url',
method: 'POST',
data: {var:'val'},
// data: JSON.stringify({var:'val'}), // send data in the request body
// contentType: "application/json; charset=utf-8", // if sending in the request body
dataType: 'json'
}).done(function(data, textStatus, jqXHR) {
// because dataType is json 'data' is guaranteed to be an object
console.log('done');
@stefanorossiti
stefanorossiti / 1_phpunit-api.md
Created October 20, 2017 06:53 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@stefanorossiti
stefanorossiti / 1_phpunit-api.md
Created October 20, 2017 06:53 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()