Skip to content

Instantly share code, notes, and snippets.

View flug's full-sized avatar
:octocat:
yeah yeah yeah

Flug flug

:octocat:
yeah yeah yeah
View GitHub Profile
@flug
flug / AbstractType.php
Last active August 29, 2015 14:24
An abstract class for reflect entity
<?php
namespace My\Bundle\FrontendBundle\Form;
use Symfony\Component\Form\AbstractType as SymfonyAbstractType;
use Symfony\Component\Form\FormBuilderInterface;
abstract class AbstractType extends SymfonyAbstractType
{
@flug
flug / gist:bc930bcce1c39475331f
Created July 20, 2015 12:32
stopwords elasticsearch
"stopwords" : ["ès", "vers", "a", "à", "afin", "ai", "ainsi", "après", "attendu", "au", "aujourd", "auquel", "aussi", "autre", "autres", "aux", "auxquelles", "auxquels", "avait", "avant", "avec", "avoir", "c", "ça", "car", "ce", "ceci", "cela", "celle", "celles", "celui", "cependant", "certain", "certaine", "certaines", "certains", "ces", "cet", "cette", "ceux", "chez", "ci", "combien", "comme", "comment", "concernant", "contre", "d", "dans", "de", "debout", "dedans", "dehors", "delà", "depuis", "derrière", "des", "dès", "désormais", "desquelles", "desquels", "dessous", "dessus", "devant", "devers", "devra", "divers", "diverse", "diverses", "doit", "donc", "dont", "du", "duquel", "durant", "elle", "elles", "en", "entre", "environ", "est", "et", "etc", "été", "etre", "être", "eu", "eux", "excepté", "hélas", "hormis", "hors", "hui", "il", "ils", "j", "je", "jusqu", "jusque", "l", "la", "là", "laquelle", "le", "lequel", "les", "lesquelles", "lesquels", "leur", "leurs", "lorsque", "lui", "ma", "mais", "malgré", "
# delete all data
curl -XDELETE localhost:9200/test
# create an index and define specific french stop_words
curl -XPUT localhost:9200/test -d '{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
"french" : {
/***************** WP Config ************************/
define('FS_METHOD', 'direct');
define('FTP_BASE', '/path/to/wordpress/');
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');
define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', 'ftp.example.org');
define('FTP_SSL', false);
// /classes/pdf/HTMLTemplate.php
public $id_commande = 0 ;
// Line ~52
$this->smarty->assign(array(
'logo_path' => $path_logo,
'img_ps_dir' => 'http://'.Tools::getMediaServer(_PS_IMG_)._PS_IMG_,
'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'),
# Htaccess
Header unset ETag
FileETag None
@flug
flug / gist:5744813
Created June 9, 2013 19:21
Authentification Email Cakephp
public $components = array(
"Auth" => array(
'authenticate' => array(
'Form' => array(
'fields' => array('username' => 'email')
)
)
)
);
#!/bin/bash
for i in *.gif; do convert "$i" "${i%.gif}.png"; done
@flug
flug / gist:7606916
Created November 22, 2013 21:09
Symlink all file of directory
ln -s /mnt/usr/lib/* /usr/lib/
<navigation:Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:player="clr-namespace:SilverlightAdvancedPlayer.Player;assembly=Core"
xmlns:smf="http://schemas.microsoft.com/smf/2010/xaml/player"
xmlns:Microsoft_SilverlightMediaFramework_Utilities_Offline="clr-namespace:Microsoft.SilverlightMediaFramework.Utilities.Offline;assembly=Microsoft.SilverlightMediaFramework.Utilities"
xmlns:System="clr-namespace:System;assembly=mscorlib"