Skip to content

Instantly share code, notes, and snippets.

View kandran's full-sized avatar

SAEZ Jonathan kandran

View GitHub Profile
@kandran
kandran / README.md
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
kandran / gist:25cd8ca56427baa18283
Last active August 29, 2015 14:07
sql oracle exo conception
-- CREATE customer table
CREATE TABLE customer
( 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)
);
<?php
require_once("Ship.php");
class Accelerator extends Ship
{
protected $ship;
public function __construct(Ship $ship)
{
<?php
require_once('Document.php');
class ConfigDocument extends Document
{
}
@kandran
kandran / visitor.java
Last active August 29, 2015 14:18
Design pattern visitor en java (http://kandran.fr/design-pattern-visiteur)
interface IVisitable {
void accept(IVisitor visitor);
}
class Book implements IVisitable
{
public String support = "unknown";
public void accept(IVisitor visitor)
{
@kandran
kandran / README.md
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.

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