Skip to content

Instantly share code, notes, and snippets.

Avatar

Gilles Doge gido

View GitHub Profile
@Seldaek
Seldaek / ext-requires.txt
Last active Feb 15, 2020
PHP Extension Requirements on Packagist.org
View ext-requires.txt
Taken from packagist.org
Packages with a master branch update since June 1st 2018: 98977
Of those, package having requires on PHP extensions: 11676 (11.79%)
As only ~12% of packages declare their extension requirements,
and even then it might not be a complete list, take all this with
a big grain of salt, it is informative but definitely not a
complete picture of the most used extensions.
@w00fz
w00fz / sphp.sh
Last active Feb 7, 2022
PHP switcher
View sphp.sh
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@nateevans
nateevans / MenuBuilder.php
Created Apr 3, 2014
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (see http://bit.ly/1sd1rJr , thanks to Niels Mouthaan!)
View MenuBuilder.php
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@Turin86
Turin86 / WSSoapClient.php
Last active Nov 13, 2021 — forked from johnkary/WSSoapClient.php
WS-Security for PHP SoapClient
View WSSoapClient.php
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*
@srayhunter
srayhunter / configure-apache-path-environment-variable-on-macosx.md
Last active Apr 27, 2022
Configure Apache on Mac OSX with Environment Variables
View configure-apache-path-environment-variable-on-macosx.md

Configure Apache Path Environment Variable on Mac OSX

Problem: Apache2/PHP did not find a program to execute on its configured path

Solution: Add a new path of /usr/local/bin to Apache2's path where the program was installed

  1. Edit the Apache2 plist file with whatever editor you like (example using vim):

     $ sudo vim /System/Library/LaunchDaemons/org.apache.httpd.plist
    
@mbostock
mbostock / .block
Last active Sep 6, 2021
Swiss Cantons
View .block
license: gpl-3.0
@lluchs
lluchs / html5.php
Created Aug 9, 2012
HTML Purifier definition for some HTML5 tags
View html5.php
<?php
// http://developers.whatwg.org/sections.html
$def->addElement('section', 'Block', 'Flow', 'Common');
$def->addElement('nav', 'Block', 'Flow', 'Common');
$def->addElement('article', 'Block', 'Flow', 'Common');
$def->addElement('aside', 'Block', 'Flow', 'Common');
$def->addElement('header', 'Block', 'Flow', 'Common');
$def->addElement('footer', 'Block', 'Flow', 'Common');
@real34
real34 / HttpAuth-Recipe.rb
Created Apr 5, 2012
Capistrano : Http Authentification recipe - Generates htaccess/htpasswd Apache protection for your project
View HttpAuth-Recipe.rb
##
# HTTP Authentification deployment Recipe
# => Add htaccess password protection when deploying, with the correct htpassword file for the passed users
##
_cset (:http_auth_users) {[
["admin", "password"]
]}
_cset (:http_auth_path) { "" } # Path of the directory to add http auth, from the release root
namespace :httpAuth do
@xanf
xanf / AjaxAuthenticationListener.php
Created Jun 8, 2011
AJAX auth errors listener for Symfony2
View AjaxAuthenticationListener.php
<?php
namespace Application\ProdrepHelperBundle\Component\Event;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
/**
*/
class AjaxAuthenticationListener
@eric1234
eric1234 / config.js
Created Jun 18, 2010
Basecamp theming for CKEditor
View config.js
CKEDITOR.lang.load('en', 'en', function() {
CKEDITOR.lang['en']['numberedlist'] = 'Numbers';
CKEDITOR.lang['en']['bulletedlist'] = 'Bullets';
CKEDITOR.replace('project_description', {
toolbar: [['Bold', 'Italic', '-', 'NumberedList', 'BulletedList']],
toolbarCanCollapse: false,
resize_enabled: false,
customConfig: '',
removePlugins: 'elementspath'
});