Blogue

Total Wireframe – Une banque de modèle pour le prototyping…

June 23rd, 2009 / by Wibeset / 0 comment

Total Wireframe est une shop de components pour l’outil de prototypage Axure. Vous y trouverez plein de modèle pour vos prototypes comme la boîte de Facebook Connect, Google maps, un player Vimeo, un player Youtube, etc.

Alors si vous prototypez sur Axure, allez tout de suite sur Total Wireframe. :)

Oh, et pour les Twitteux de ce monde, suivez Total Wireframe sur @totalwireframe.

Du mouvement…

June 21st, 2009 / by Wibeset / 0 comment

À partir d’aujourd’hui, http://wibe7.tv devient http://tv.wibeset.com et http://propulse.ca devient http://propulse.wibeset.com.

Client PHP5 pour Twitter

April 5th, 2009 / by Wibeset / 0 comment

Mini client PHP5 pour mettre à jour votre statut sur Twitter:

<?php

/**
 * Twitter client
 *
 * @see Twitter
 * @see Twitter API documentation
 *
 */

class twitter {

  protected $url = "http://twitter.com/";

  /**
   * cURL instance
   */
  protected $ch = null;

  /**
   * Authentication
   */
  protected $username = '';
  protected $password = '';
  protected $authentication = '';

  /**
   * Constructor
   */
  public function __construct() {
    $this->ch = curl_init();
    curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($this->ch, CURLOPT_HEADER, 0);
    curl_setopt($this->ch, CURLOPT_VERBOSE, 0);
  } // __construct()

  /**
   * Destructor
   */
  public function __destruct() {
    curl_close($this->ch);
  } // __destruct()

 /**
   * Set user authentication
   *
   * @param username (string)
   * @param password (string)
   *
   */
  public function set_authentication($username, $password) {

    $this->username = $username;
    $this->password = $password;
    $this->authentication = $this->username.':'.$this->password;

  } // set_authentication()

  /**
   * Update the authenticating user's status
   * Authentication must be setted.
   *
   * @param status_text (string) new user's status
   *
   */
  public function update($status_text) {

    curl_setopt($this->ch, CURLOPT_URL, $this->url."statuses/update.json");
    curl_setopt($this->ch, CURLOPT_USERPWD, $this->authentication);
    curl_setopt($this->ch, CURLOPT_POST, 1);
    curl_setopt($this->ch, CURLOPT_POSTFIELDS, array('status' => $status_text));

    $result = curl_exec($this->ch);

    return json_decode($result, true);

  } // update()

} // twitter

Demo:

 $twitter = new twitter();
  $twitter->set_authentication('username', 'password');
  $twitter->update('hello from my new php5 client :)');

Pré-requis: cURL enabled et PHP >= 5.2.0

Highlighter son code dans un billet…

March 27th, 2009 / by Wibeset / 0 comment

J’ai découvert récemment un petit plugin JavaScript vraiment cool qui permet d’highlighter du code. D’ailleurs, je l’ai utilisé pour la première fois dans le billet “Obtenir un permalink en JavaScript“.

Ce plugin supporte les langages suivant: C++, PHP, Javascript, CSS, C#, Delphi, Java, Python, Ruby, Sql, VB et XML/HTML.

Google Syntax Highlighter

Un court aperçu Php:

  <?php

  // Best PHP script I ever made ;)
  echo 'Hello world!';

Obtenir un permalink en JavaScript

March 27th, 2009 / by Wibeset / 0 comment

La fonction to_permalink() est une simple fonction JavaScript qui vous permettra de transformer une string en permalink.

/**
 * Return string as permalink
 */
function to_permalink(str) {

  // remove accent
  str = str.replace(/[?| âä]/gi,"a");
  str = str.replace(/[éèêë]/gi,"e");
  str = str.replace(/[îï]/gi,"i");
  str = str.replace(/[ôö]/gi,"o");
  str = str.replace(/[ùûü]/gi,"u");

  // remove special chars
  str = str.replace(/[^a-z0-9_]/gim, "_").replace(/[_+]/gi, "_");

  return str;
}

Un exemple…


  var str = "Je suis le titre d'un article époustouflant!";

  // Retournera le permalink 'Je_suis_le_titre_dun_article_epoustouflant'
  var permalink = to_permalink(str);