Skip to content

Instantly share code, notes, and snippets.

View fabiocarneiro's full-sized avatar

Fábio Carneiro fabiocarneiro

View GitHub Profile
@fabiocarneiro
fabiocarneiro / fix.md
Last active December 19, 2017 17:33
Fix Jetbrains IDE hotkey bug on Ubuntu 17.10 after moving from Unity

Show current settings

setxkbmap -print -verbose 10

Change to abnt2 layout (need to be adjusted according to the keyboard model):

setxkbmap -model abnt2 -layout br -variant abnt2

<?php
class ExampleFactory
{
/**
* @param DI $di
*/
public function __invoke(DI $di)
{
$dependency = $di->get(Dependency::class);
<?php
define('x', true);
$preg_mobile = preg_match('/android|mobile|iphone|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos/i',
$_SERVER['HTTP_USER_AGENT']);
require './includes/config.php';
require './includes/functions.php';
require './includes/skin.php';
$db = new MySQLi($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']);
if (! $db) {
die('Falha ao conectar ao MySQL');
> db.Category.find().toArray();
[
{
"_id" : ObjectId("552c3964312f07010e828c21"),
"active" : true,
"featured" : true,
"name" : "Smartphone",
"slug" : "smartphone",
"description" : "",
"children" : [ ]
0 undefined
1 undefined
>
<form action>
</form>
<?php
namespace Application\Controller\Factory;
use Application\Controller\MyController;
class MyControllerFactory
{
/**
* @param ControllerManager $controllerManager
<?php
use Money\Money;
use Product\Model\Prices;
return [
Prices::class => [
'type' => 'embeddedDocument',
'orm' => [
'embedOne' => [
<?php
use Money\Money;
use Product\Model\Prices;
return [
Prices::class => [
'type' => 'embeddedDocument',
'embedOne' => [
[
#!/bin/bash
# thanks http://www.jenssegers.be/blog/46/deploying-websites-with-git-and-composer-
# replace folder
cd "`dirname $0`/../../application/config"
# Check if a composer.json file is present
if [ -f composer.json ]; then