Skip to content

Instantly share code, notes, and snippets.

View gyndav's full-sized avatar
👋

David Guyon gyndav

👋
View GitHub Profile
brew remove php56 php56-igbinary php56-mcrypt php56-memcached php56-redis php56-xdebug php56-msgpack;
brew install php56 --disable-opcache --with-homebrew-curl --with-homebrew-libxslt --with-homebrew-openssl --without-apache --without-fpm;
brew install php56-igbinary;
brew install php56-mcrypt;
brew install php56-memcached --with-igbinary;
brew install php56-redis --with-igbinary;
brew install php56-msgpack;
brew install php56-xdebug;
@gyndav
gyndav / MyClassControllerProvider.php
Created November 9, 2012 09:26
Other implementation for decoupling controllers in Silex
<?php
namespace MyCompany\ControllerProvider;
use Silex\ControllerProviderInterface,
Silex\ControllerCollection,
Silex\Application,
Silex\Route;
/**
@gyndav
gyndav / .travis.yml
Created April 10, 2012 12:57
Simple Mongo PHP Driver extension installer for Travis CI. Works like a charm for other PECL extensions too.
before_script:
- ./path/to/mongo-php-driver-installer.sh
@gyndav
gyndav / gist:2002661
Created March 8, 2012 18:51
Atoum VS PHPUnit
Avantages d'atoum sur PHPUnit :
# Sa rapidité
C'est "blazing fast". SERIOUSLY
# Simplicité de l'API
La documentation de PHPUnit est tellement longue qu'on s'y perd : la seule documentation dont j'ai eu besoin pour utiliser atoum, c'est son README et quelques posts du wiki parmi le bootstrap, le changement du namespaces pour les classes de tests et les mocks.
La lecture du code source pour les classes d'assert aussi.
@gyndav
gyndav / gist:1883439
Created February 22, 2012 08:35
Skip iPhone URL bar
/mobile/i.test(navigator.userAgent) && !location.hash && setTimeout(function () {
if (!pageYOffset) window.scrollTo(0, 1);
}, 1000);​
@gyndav
gyndav / gist:1820829
Created February 13, 2012 21:59
Using jinja2 within web.py
#!/usr/bin/env python
import os
import web
from jinja2 import Environment,FileSystemLoader
# Router
urls = (
"/.*", "hello",
'/contact', 'rsvp'
@gyndav
gyndav / jquery.isInlineFilter
Created September 2, 2011 07:56
jQuery filter for querying all "display: inline" elements
$.extend($.expr[:], {
isInline: function(e) {
return $(e).css('display') == 'inline';
}
})
@gyndav
gyndav / gist:1185619
Created September 1, 2011 07:06
CSS3 link hover transition
a {
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
-o-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
}
@gyndav
gyndav / async.js
Created June 10, 2011 13:42
Adding script tag asynchronously
<script type="text/javascript">
(function(){
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(s);
})();
</script>
@gyndav
gyndav / no-www
Created May 30, 2011 17:10
Redirect www to non-www domain
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]