Skip to content

Instantly share code, notes, and snippets.

View clemherreman's full-sized avatar

Clement Herreman clemherreman

  • Exotec
  • Lille, France
View GitHub Profile
@clemherreman
clemherreman / gist:0079334759272518f9d3
Last active October 8, 2019 13:09
CLI xdebug distant VM
alias phpdebug='PHP_IDE_CONFIG="serverName=website.dev" XDEBUG_CONFIG="idekey=PHPSTORM" php -d xdebug.remote_host=10.0.2.2 -d xdebug.remote_connect_back=0'
@clemherreman
clemherreman / Collection.php
Last active August 29, 2015 14:00
WTF collection
<?php
class Collection
{
/**
* Gets an item from the collection
*
* @param $item
* @return string|null
*/
public function get($item)
@clemherreman
clemherreman / output
Last active December 31, 2015 19:59
WTFred
clemherreman@macclem ~ $ php -v
PHP 5.4.3 (cli) (built: Jun 6 2012 11:03:31)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
clemherreman@macclem ~ $ php test.php
Content:
.container_home .crm .bd_e{foo) repeat-x
@clemherreman
clemherreman / BusinessContext.php
Last active December 24, 2015 07:40
FeatureContext
<?php
use Behat\Behat\Context\Step\Given;
use Behat\Behat\Context\Step\When;
use Behat\Mink\Element\Element;
use Behat\Mink\Exception\ExpectationException;
use Behat\MinkExtension\Context\RawMinkContext;
use FooInterface;
Vagrant::Config.run do |config|
config.vm.box = "centos-6.3"
config.vm.host_name = "ps3.profilsearch.com"
# config.vm.boot_mode = :gui
config.vm.network :hostonly, "192.168.33.10"
config.vm.share_folder "v-data", "/vagrant_data", "../..", :nfs => true
config.vm.customize ["modifyvm", :id, "--name", "Profilsearch"]
config.vm.customize ["modifyvm", :id, "--memory", 1024]
config.vm.customize ["modifyvm", :id, "--cpus", 2]
@clemherreman
clemherreman / output.txt
Created May 11, 2013 14:25
krr install trouble
clemherreman@macclem ~/Boulot/Perso $ git clone https://github.com/kud/krr.git
Cloning into krr...
remote: Counting objects: 250, done.
remote: Compressing objects: 100% (158/158), done.
remote: Total 250 (delta 76), reused 238 (delta 64)
Receiving objects: 100% (250/250), 236.43 KiB | 163 KiB/s, done.
Resolving deltas: 100% (76/76), done.
clemherreman@macclem ~/Boulot/Perso $ cd krr/
clemherreman@macclem ~/Boulot/Perso/krr $ npm install
npm http GET https://registry.npmjs.org/feedparser
@clemherreman
clemherreman / should_work.php
Last active December 16, 2015 14:59
request_fulluri Composer/github bug
<?php
$options = array(
'http' => array(
'method' => 'GET',
'verify_peer' => false,
'allow_self_signed' => true,
'follow_location' => 1,
'max_redirects' => 20,
'proxy' => 'tcp://your.proxy.ip:yourProxyPort',
// Uncomment the following line to reproduce the bug
// Count the numbers of attached files
if (!empty($tabProprietes))
{
foreach ($tabProprietes as $prop)
{
$count++;
}
}
@clemherreman
clemherreman / commands.sh
Last active December 11, 2015 07:09
Setup jenkins on Debian 6.0.6
# Java is needed
sudo apt-get install openjdk-6-jdk
# Install jenkins for their repository
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
# Optional: setup pear
@clemherreman
clemherreman / composer.json
Last active December 10, 2015 23:38
Private repositories in composer.json
{
"repositories" : [
{
"type": "vcs",
"url": "https://github.com/my/package"
},
"require": {
"my/package": "*"
}
}