Skip to content

Instantly share code, notes, and snippets.

Maykonn Welington Candido Maykonn

Block or report user

Report or block Maykonn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Maykonn / hierarchical_parent_id_recursive_query.sql
Last active Mar 13, 2019
[SQL] Retrieves results in a hierarchy starting from a specific register (recursive parent_id)
View hierarchical_parent_id_recursive_query.sql
* Retrieves a customer group hierarchy.
* Change the @root_id value to change the hierarchy root.
SET @root_id = 1;
ORDER BY parent_id, id) hiearchy_sorted,
Maykonn / maykonn-php-code-style.xml
Created Jan 24, 2019
PHP Code Style for PHPStorm IDE
View maykonn-php-code-style.xml
<code_scheme name="maykonn-php-code-style" version="173">
<option name="CONCAT_SPACES" value="false" />
<codeStyleSettings language="PHP">
<option name="SPACE_AFTER_TYPE_CAST" value="true" />
Maykonn /
Last active Jan 24, 2019
This gist is a .sh file which test if a service is running, you may change as necessary for your needs
if (( $(ps -ef | grep -v grep | grep ${local_mysql_service} | wc -l) > 0 ))
service ${local_mysql_service} stop
echo "Conflicting local services stopped ($local_mysql_service), continue..."
Maykonn / Maykonn-Symfony-4-Code-Style.xml
Created Aug 9, 2018
PHP Code Style for PHPStorm IDE based on Symfony 4 Skeleton App
View Maykonn-Symfony-4-Code-Style.xml
<code_scheme name="Maykonn-Symfony-4-Code-Style" version="173">
<option name="CONCAT_SPACES" value="false" />
<codeStyleSettings language="PHP">
<option name="SPACE_AFTER_TYPE_CAST" value="true" />
Maykonn /
Last active Oct 22, 2018
SQL search by specific string in a comma separated string (Solution for Redshift too).

Will return 0 or false:

SELECT "5,18,5,7,9,2" REGEXP "[[:<:]](8)[[:>:]]"

Will return 1 or true:

SELECT "5,18,5,7,9,2" REGEXP "[[:<:]](5)[[:>:]]"

For Redshift you must use ~ instead REGEXP on above statements:

Maykonn / twitter-request-token.php
Created Jan 23, 2018
Twitter Integration: Backend endpoint to request token
View twitter-request-token.php
* Twitter Integration: Backend endpoint to request token
* @author Maykonn Welington Candido<>
* @see
* @uses This file must be requested by a application passing the callback_url on querystring. Response Content-Type is application/json.
* @example


Operating System Ubuntu 14.04 via

Install node.js

sudo apt-get update
sudo apt-get install nodejs

Check node.js version

Maykonn / gist:9f135e83ab27b1c9e4fc
Last active Jan 23, 2018 — forked from fernandojunior/gist:0c1bcf595c16a059fc5d
Install mysql and/or workbench on ubuntu
View gist:9f135e83ab27b1c9e4fc
# Install mysql server 5.6 on Ubuntu
apt-get install mysql-server-5.6
# Login into MySQL Server
mysql -uroot -p
# restart mysql server
sudo service mysql start|restart|stop|status
Maykonn /
Last active Aug 29, 2015
How to enable CORS in Laravel 5.0?

Is common a [CORS][1] message when accessing a Laravel Application (or better, an Laravel API), resource via another client application (an Angular.js, Backbone.js, Ember.js, or a PHP, JS, Java, Mobile, app, whatever).

To enable CORS in your Laravel application, create a route group and put inside, all routes that you need to enable CORS:

Route::group(['after' => 'allowOrigin'], function() {
    // Your fantastic resources
    Route::post('/users', function () {  // ... });
    // ...
View currency_symbols.php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
You can’t perform that action at this time.