Nicolas Grekas - nicolas.grekas, gmail.com
17 juin 2011 - Dernière mise à jour le 3 sept. 2011
Ce gist n'est plus mis à jour. Voir maintenant :
Nicolas Grekas - nicolas.grekas, gmail.com
17 juin 2011 - Dernière mise à jour le 3 sept. 2011
Ce gist n'est plus mis à jour. Voir maintenant :
<?php /****************** vi: set fenc=utf-8 ts=4 sw=4 et: ***************** | |
* | |
* Copyright : (C) 2011 Nicolas Grekas. All rights reserved. | |
* Email : [email protected] | |
* License : http://www.gnu.org/licenses/lgpl.txt GNU/LGPL | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as | |
* published by the Free Software Foundation, either version 3 of the | |
* License, or (at your option) any later version. |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
<?php | |
/** | |
Truncate Html string without stripping tags | |
register in Resources/config/services.yml with: | |
services: | |
truncatehtml.twig.extension: | |
class: Radley\TwigExtensionBundle\Extension\TruncateHtmlExtension | |
tags: | |
- { name: twig.extension } |
Day 1 (Track A): | |
Keynote - Fabien Potencier | |
Security: In Real Life - Johannes S | |
https://speakerdeck.com/u/schmittjoh/p/security-in-real-life | |
How we built the new responsive BBC News site - John Cleveley | |
https://speakerdeck.com/u/jcleveley/p/how-we-built-the-new-responsive-bbc-news-site |
jQuery(function($) { | |
$('form[data-async]').live('submit', function(event) { | |
var $form = $(this); | |
var $target = $($form.attr('data-target')); | |
$.ajax({ | |
type: $form.attr('method'), | |
url: $form.attr('action'), | |
data: $form.serialize(), |
#Postgresql 9.2.1 Compilation instructions for Ubuntu 12.04 | |
#This will install Postgresql 9.2.1 into /usr/local/postgresql-9.2.1 | |
#This assumes that you have sudo provileges on the machine installing postgresql | |
#It should work by copying and pasting into the shell, I haven't tested it, I just summarized | |
#what I just did and it worked | |
#Get requirements | |
sudo apt-get install build-essential libreadline6-dev zlib1g-dev |
// create an index with an analyzer "myindex" | |
curl -X PUT localhost:9200/myindex -d ' | |
{ | |
"settings" : {` | |
"index":{ | |
"number_of_replicas":0, | |
"number_of_shards":1, | |
"analysis":{ | |
"analyzer":{ | |
"first":{ |