Skip to content

Instantly share code, notes, and snippets.

View stefgosselin's full-sized avatar

Stephane Gosselin stefgosselin

  • Saint-Eugène-De-Guiges
View GitHub Profile
@stefgosselin
stefgosselin / l.php
Created March 8, 2014 16:32 — forked from adriengibrat/l.php
Autoload in include path
<?php
//set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); // optional
spl_autoload_register(function ($class) {
$file = preg_replace('#\\\|_(?!.+\\\)#','/', $class) . '.php';
if (stream_resolve_include_path($file))
require $file;
});
(function ($) {
Drupal.behaviors.myModule = {
attach: function (context) {
// Code ...
}
}
})(jQuery);

unicorn config file

Edit file /home/gitlab/gitlab/config/unicorn.rb

Find line listen "#{app_dir}/tmp/sockets/gitlab.socket" and comment it. Uncomment line listen "127.0.0.1:8080"

required modules for apache

  • sudo a2enmod proxy
  • sudo a2enmod proxy_http
@stefgosselin
stefgosselin / drushinstall.txt
Created June 11, 2013 04:20
Installation - Drush
Installation drush
cd /usr/local/lib/
wget http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz
tar zxvf drush-7.x-5.9.tar.gz
cd drush/ <-----There is drush, just checking
cd /usr/local/bin
ln -s /usr/local/lib/drush/drush drush
Then:
Go to the root folder of your website
@stefgosselin
stefgosselin / generate-compose.sh
Created November 24, 2016 21:28 — forked from lalyos/generate-compose.sh
generate docker-compose.yml by inspecting a running container
docker-yml() {
docker inspect -f $'
{{.Name}}
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
environment: {{range .Config.Env}}
- {{.}}{{end}}
' $1
}
@stefgosselin
stefgosselin / gluu_installer
Created January 30, 2017 20:13
Gluu initial base install - centOS 7
#!/usr/bin/bash
#######################################
# Helper script to install gluu-server
########################################
GLUU_VERSION=2.4.4.2
wget https://repo.gluu.org/centos/Gluu-centos7.repo -O /etc/yum.repos.d/Gluu.repo
wget https://repo.gluu.org/centos/RPM-GPG-KEY-GLUU -O /etc/pki/rpm-gpg/RPM-GPG-KEY-GLUU
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-GLUU
@stefgosselin
stefgosselin / index.samle.html
Created April 15, 2017 20:30
Base html5 template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sample site</title>
<meta name="description" content="Sample site">
<meta name="author" content="SampleSite">
@stefgosselin
stefgosselin / docker-ci-tool-stack.sh
Created June 26, 2017 16:26 — forked from marcelbirkner/docker-ci-tool-stack.sh
Getting started with docker CI tool stack
git clone git@github.com:marcelbirkner/docker-ci-tool-stack.git
cd docker-ci-tool-stack
docker-compose up
@stefgosselin
stefgosselin / phplint.sh
Created September 28, 2017 18:04 — forked from mathiasverraes/phplint.sh
Recursive PHP Lint script
#!/bin/bash
for file in `find .`
do
EXTENSION="${file##*.}"
if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ]
then
RESULTS=`php -l $file`
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the