Skip to content

Instantly share code, notes, and snippets.

View killerwolf's full-sized avatar

Hamdi LAADHARI killerwolf

View GitHub Profile
$ docker run --rm -it --net=host killerwolf/phptoolbelt phpunit --version
PHPUnit 5.3.2 by Sebastian Bergmann and contributors.
$ docker run --rm -it --net=host killerwolf/phptoolbelt composer --version
Composer version 1.0.2 2016-04-21 12:30:18
$ docker run --rm -it --net=host killerwolf/phptoolbelt phing -v
Phing 2.14.0
FROM php:7.0.5-alpine
MAINTAINER Hamdi LAADHARI @killerwolf
ENV COMPOSER_VERSION 1.0.2
ENV PHING_VERSION 2.14.0
ENV PHPUNIT_VERSION 5.3.2
ENV PATH $PATH:/root/.composer/vendor/bin/
@killerwolf
killerwolf / apicall.php
Created August 7, 2015 19:39
S.O.L.I.D for Dummies
<?php
class APICall{
const API_ENDPOINT = "http://api.example.org/v1/en/users.json";
public $query = [];
public function buildQuery(array $query)
{
return http_build_query($query);
@killerwolf
killerwolf / image.ini
Created June 23, 2015 23:10
thumbnail ezpublish
Filters[]=geometry/thumbnailize=-thumbnail "%1x%2^" -gravity center -extent %1x%2
Filters[]=geometry/thumbnailize2=-geometry %1x%2^ -gravity center -crop %1x%2+0+0 +repage
// ==UserScript==
// @name Google Sponsored Links remover
// @namespace http://www.h4md1.fr
// @description remove google sponsored links from SERPS
// @include http://www.google.com/*
// ==/UserScript==
(function() {
var sidebarads = document.getElementById(‘mbEnd’);
var skyads = document.getElementById(‘tads’);
@killerwolf
killerwolf / page.html
Last active August 29, 2015 14:20
selenium test
<html>
<script>
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://www.google.com');
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');

Keybase proof

I hereby claim:

  • I am killerwolf on github.
  • I am h4md1 (https://keybase.io/h4md1) on keybase.
  • I have a public key whose fingerprint is 148B A60F 2006 C020 81D9 0651 35D2 8E16 D939 41B1

To claim this, I am signing this object:

@killerwolf
killerwolf / enclosure-tag.rss
Created April 21, 2013 16:28
eZ Publish - Import RSS natif de la balise enclosur url
<enclosure url="http://www.example.com/images/voiture.jpg" length="" type="image/jpeg"/>
@killerwolf
killerwolf / gist:4246243
Created December 9, 2012 17:41
lightdm log
[+314.00s] DEBUG: Greeter start authentication for killerwolf
[+314.00s] DEBUG: Started session 4960 with service 'lightdm', username 'killerwolf'
[+314.01s] DEBUG: Session 4960 got 1 message(s) from PAM
[+314.01s] DEBUG: Prompt greeter with 1 message(s)
[+314.08s] DEBUG: Greeter start authentication for killerwolf
[+314.08s] DEBUG: Session 4960: Sending SIGTERM
[+314.08s] DEBUG: Started session 4962 with service 'lightdm', username 'killerwolf'
[+314.08s] DEBUG: Session 4960 terminated with signal 15
[+314.08s] DEBUG: Session 4960 failed during authentication
[+314.10s] DEBUG: Session 4962 got 1 message(s) from PAM
@killerwolf
killerwolf / extractUrlParams.js
Created August 19, 2011 08:53
extractUrlParams
////////////////////////////////////////////////
// Fonction de récupération des paramètres GET de la page
// @return Array Tableau associatif contenant les paramètres GET
////////////////////////////////////////////////
function extractUrlParams(){
var t = location.search.substring(1).split('&');
var f = [];
for (var i=0; i<t.length; i++){
var x = t[ i ].split('=');
f[x[0]]=x[1];