Skip to content

Instantly share code, notes, and snippets.

View mikamboo's full-sized avatar
🏠
Working from home

Michaël P.O. mikamboo

🏠
Working from home
View GitHub Profile
@mikamboo
mikamboo / gist:5524804
Last active December 17, 2015 00:59
Play Framework 2.x on windows with Eclipse from Scratch course. Run on local and deploy on Heroku.

Play Framework installation

  1. Downloads & prerequistes

  • Play Framework : Link
  • Heroku Toolbelt : Link
  1. Environment variables

@mikamboo
mikamboo / gist:5524813
Last active December 17, 2015 00:59
Create a new Android project with Robolectric unit test support

Use Roboelectric for unit test on Android apps

@mikamboo
mikamboo / gist:5529157
Last active December 17, 2015 01:30
Installation application ZF-2 PHP

Installation application serveur

I - Init projet ZF2

  • Récupérer le projet sur le repo Git et fair un checkout

  • Le dossier du projet contient l'utilitaire composer.phar et composer.json

  • Ouvrir la console naviguer dans le dossier du projet, exec cmd : php composer.phar update

@mikamboo
mikamboo / gist:5548002
Created May 9, 2013 14:59
Using PHP cURL to send a message (with retry in case of failure) to a Google Cloud Messaging registered device.
<?php
define('CURL_EXEC_RETRY_MAX',3);
define('GCM_SERVER_URL',"https://android.googleapis.com/gcm/send");
define('GCM_API_KEY',"YOUR_API_KEY");
/**
* Using PHP to send a message to a Google Cloud Messaging registered device is quite simple.
* In this class we're using curl to create a message request to send to the Google GCM server.
* This class require an GCM Api key cf. {@link https://code.google.com/apis/console/}
@mikamboo
mikamboo / gist:5558113
Last active December 17, 2015 05:29
Eclipse usefull shortkuts.

Eclipse shortcuts

  • Format code

  • Ctrl+Shift+F to invoke the Auto Formatter
  • Ctrl+I to indent the selected part (or all) of you code.
  • Refractor

@mikamboo
mikamboo / gist:5590184
Created May 16, 2013 08:09
Serialisatoin & Désérialisation en PHP d'un tableau dans un fichier.
<?php
//-----------------------------------------------------------
// Serialisatoin & Désérialisation tableau <-> fichier
//-----------------------------------------------------------
echo "<pre>"; print_r($tab_lst_interventions);
$str_dateLog = date('Ymd_His');
$str_cheminLog = CHEMIN_APPLI.'/logs/'.$str_dateLog;
@mikamboo
mikamboo / gist:5604508
Last active December 17, 2015 11:48
Raccourcis commandes utiles sous PostgreSQL

PostgreSQL commands

Show databases :

postgresql: \l
postgresql: SELECT datname FROM pg_database;

Show tables :

@mikamboo
mikamboo / gist:5684516
Last active December 17, 2015 22:49 — forked from anonymous/gist:5684491
Java create a class : constructors & get / set methods
/**
* Classe Personne
* Décrit un objet personne par son nom et son age
*
*/
public class Personne {
private String name;
private int age;
@mikamboo
mikamboo / gist:5693136
Last active December 17, 2015 23:58
Java design pattern : Singleton
public class MySingleton {
private static MySingleton instance;
public String customVar;
public MySingleton()
{
if (instance == null)
{
@mikamboo
mikamboo / gist:5771914
Created June 13, 2013 07:45
LDAP Connect Java (2010)
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Hashtable;
import javax.naming.*;
import javax.naming.directory.*;
import javax.swing.*;
public class LDAP_connect extends JDialog implements ActionListener {