Skip to content

Instantly share code, notes, and snippets.

klederson /
Last active Apr 21, 2021
How to setup PHP CodeSniffer into PHP Storm with Mac OSX

Good Practices

PHP CodeSniffer into PHP Storm

Install PHPCS in mac

sudo cp /private/etc/php.ini.default /private/etc/php.ini;
sudo php /usr/lib/php/install-pear-nozlib.phar;
pear config-set php_ini /private/etc/php.ini;
View CountryCodes.json
"items": [
"code": "+93",
"country": "Afghanistan"
"code": "+355",
"country": "Albania"
klederson / 0_reuse_code.js
Created Dec 12, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View screen.po
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Klederson Bueno <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
klederson / Gettext.js
Created Apr 23, 2013
support file for the tutorial on gist
View Gettext.js
Pure Javascript implementation of Uniforum message translation.
Copyright (C) 2008 Joshua I. Miller <>, all rights reserved
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
klederson / AutomaticSiteTranslation.js
Last active Dec 16, 2015
This gist demonstrate how easly integrate Gettext.js + jQuery in a smart/automatized way to translate entire sites by using some ".po" file.
View AutomaticSiteTranslation.js
* This is a experimental and fun script/tutorial that demonstrates how to translate sites USING Gettext
* without use _() stuff ( or others ) in your html just by parsing all your html visible text.
* @author Klederson Bueno <>
* @see
* @see
* @version 0.1a
var iFindTranslator = {
klederson / HTML5StorageMultidimensional.js
Created Oct 8, 2012
Adding Multidimensional Support for javascript / html5 sessionStorage , localStorage or just Storage object
View HTML5StorageMultidimensional.js
* This methods extends the default HTML5 Storage object and add support
* to set and get multidimensional data
* @example Storage.setObj('users.albums.sexPistols',"blah");
* @example Storage.setObj('users.albums.sexPistols',{ sid : "My Way", nancy : "Bitch" });
* @example Storage.setObj('users.albums.sexPistols.sid',"Other songs");
klederson / gist:3375072
Created Aug 17, 2012
Testing jquery.mentionsInput (elastic plugin forced)
View gist:3375072
lineHeight = 26//parseInt($textarea.css('line-height'),10) || parseInt($textarea.css('font-size'),'10'),
minheight = 32 //|| lineHeight*3,
maxheight = parseInt($textarea.css('max-height'),10) || Number.MAX_VALUE,
goalheight = 0;
klederson / kbueno-js-url-detection.js
Created Nov 28, 2011
Nice way to dinamicaly identify current url ( or more closer ) into a menu using javascript
View kbueno-js-url-detection.js
$(document).ready(function() {
var currentURL = metaphone(location.href);
var minPercent = 11.00;
var lastMatch = '';
$('#mymenu > ul > li > a').each(function() {
var url = $(this).attr('href');
var compare = metaphone(url);
var dist = levenshtein(currentURL,compare);
var percent = ( (dist/Math.max(currentURL.length,compare.length)) * 100 );
View exibindoImagemBanco.php
//Lendo o conteúdo oriundo do Banco de Dados
$data = $orderProduct->content;
//Criando uma imagem baseada em uma string
$dataImage = imagecreatefromstring($data);
//Se ocorreu tudo bem executar o processo de exibição da imagem
//Lembrar sempre que isso deve ser uma chamada a parte por ex: http://localhost/minhaImagem.php ou http://localhost/os/verImagem/1