Skip to content

Instantly share code, notes, and snippets.

View kandran's full-sized avatar

SAEZ Jonathan kandran

View GitHub Profile
kandran /
Last active August 29, 2015 14:03
PHP Storm Live Template

#PhpStorm Live Template

All my utils live template for phpstorm.

##Dump Value This live template is used for print a value according this type. So array and object are print by var_dump and primitive type with an echo. The END variable allow us to use a die if needed at the end of printing.

kandran / gist:25cd8ca56427baa18283
Last active August 29, 2015 14:07
sql oracle exo conception
-- CREATE customer table
( customer_id number(10) ,
name varchar2(50) not null,
date_naissance DATE,
date_creation DATE DEFAULT sysdate not null ,
CONSTRAINT customer_id_pk PRIMARY KEY (customer_id),
CONSTRAINT customer_u UNIQUE(name, date_naissance)
class Accelerator extends Ship
protected $ship;
public function __construct(Ship $ship)
class ConfigDocument extends Document
kandran /
Last active August 29, 2015 14:18
Design pattern visitor en java (
interface IVisitable {
void accept(IVisitor visitor);
class Book implements IVisitable
public String support = "unknown";
public void accept(IVisitor visitor)
kandran /
Last active August 29, 2015 14:20
AdBlock detection

#AdBlock Detection

One way to detect AdBlock is to create a file named advert.js, set a var inside and in another script detect if this specific variable has been created. If not the advert.js file has not been load probably by adBlock.

class ApplicationA implements ApplicationInterface{
public function run()
echo "<br/> Application A start running";
//some computation
echo "<br/> Application A finished";
kandran /
Last active August 29, 2015 14:24
XPath Cheatsheet
<template id="helloWord">
color: green;
<h1>Hello Word</h1>
var template = document.querySelector('#helloWord');
var clone = document.importNode(template.content, true);
var host = document.querySelector('#container');