Skip to content

Instantly share code, notes, and snippets.

@bahamut45
bahamut45 / install.md
Last active August 30, 2016 10:25
Symfony-Vich-UploaderBundle

Installation par composer

  • composer require vich/uploader-bundle

Activation du bundle dans app/AppKernel.php

<?php
class AppKernel extends Kernel
{
    public function registerBundles()
 {
@bahamut45
bahamut45 / install.md
Last active March 7, 2018 10:55
Manjaro PHP 5.6

Installation de php 7

  • pacin php php-apcu php-gd php-intl php-ldap php-mcrypt php-tidy xdebug

Installation de phpenv

  • wget -qO- https://raw.githubusercontent.com/CHH/phpenv/master/bin/phpenv-install.sh | sh
  • Modifier votre bashrc ou zshrc comme indiqué

Installation de php-build

  • git clone git://github.com/php-build/php-build.git $HOME/.phpenv/plugins/php-build
  • phpenv rehash
@bahamut45
bahamut45 / logoff.ps1
Created March 4, 2016 06:12
Powershell logon + logoff
# Filename : logoff.ps1
# Date : January 18, 2016
# Author : Nicolas JOUBERT
# Description: Logoff script
# *****************************
$strName = $env:username
$strProfile = $env:userprofile
$srvName = "srvweb"
$atomProcess = Get-Process atom -ErrorAction SilentlyContinue
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
#Creation d'un gist
@bahamut45
bahamut45 / Controller.php
Created October 14, 2015 05:03
Symfony Flash Message
<?php
$this->get('session')->getFlashBag()->add(
'notice',
array(
'type' => 'info',
'class' => 'alert alert-info fade in',
'title' => 'Message flash :',
'dismissible' => 'alert-dismissible',
'buttonClose' => '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>',
'message' => 'La page de contact n\'est pas encore disponible, merci de revenir plus tard.'
@bahamut45
bahamut45 / gist:21265c286fd3c5a9c58f
Last active September 30, 2015 20:12
Manjaro - PHP
# installer les paquets suivants
pacin php php-apcu php-gd php-intl php-ldap php-mcrypt php-pear xdebug
# Modifier le fichier /etc/php/php.ini
sudo vim /etc/php/php.ini
## Definir votre timezone
date.timezone = Europe/Paris
## Modifier la variable open_basedir
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/bin/php:/dev/null:/usr/local/bin/
## Activer les extensions suivantes
extension=exif.so
@bahamut45
bahamut45 / win_autoinstall_chocolatey.ps1
Created September 15, 2015 05:18
Installation Automatique de chocolatey
#########################
# Autoinstall script using chocolatey
#########################
function Download-File {
param (
[string]$url,
[string]$file
)
Write-Host "Downloading $url to $file" -ForegroundColor Yellow;
# Faire un update de babun
babun update
# installation de ruby rubygems rubygems-doc
pact install ruby rubygems rubygems-doc
# On verifie les versions des divers outils
git --version
@bahamut45
bahamut45 / tg-downtime
Created January 5, 2015 15:07
tg-downtime
#!/usr/bin/ruby
require 'rubygems'
require 'cgi'
require 'csv'
require 'json'
require 'pp'
# colors
BOLD = "\e[1;39m"
RESET = "\e[0m"