Skip to content

Instantly share code, notes, and snippets.

View gpassarelli's full-sized avatar

Gabriel Passarelli gpassarelli

View GitHub Profile
@gpassarelli
gpassarelli / override.php
Created January 20, 2015 19:40
Laravel Override Config
// Get config loader
$loader = $this->app['config']->getLoader();
// Get environment name
$env = $this->app['config']->getEnvironment();
// Add package namespace with path set base on your requirement
$loader->addNamespace('basset',__DIR__.'/../config/basset');
// Load package override config file
@gpassarelli
gpassarelli / gist:52bc73f3fdb7359a43c8
Created February 19, 2015 13:28 — forked from lattejed/ubuntu_basic_setup_do.sh
First 5 Minutes on server
# Note: This is for the Ubunutu 10.04 x64 image available on Digital Ocean
# and may not work for other images / OS versions.
# Warning: This script directy edits some configuration files that may
# render your OS unusable if there is an error. Use at your own risk.
useradd deploy
mkdir /home/deploy
mkdir /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
@gpassarelli
gpassarelli / alter_git_origin
Last active August 29, 2015 14:21
Alter GIT Origin Source
# View current Origin
cd /path/to/my/repo
git remote -v
git remote rm origin
# Add new Origin
$ cd /path/to/my/repo
$ git remote add origin ssh://[email protected]/username/myproject.git
$ git push -u origin master # to push changes for the first time
@gpassarelli
gpassarelli / class.php
Last active September 28, 2015 16:35
Doctrine Fill Class Attributes
/**
* Assign entity properties using an array
*
* @param array $attributes assoc array of values to assign
* @return null
*/
public function fromArray(array $attributes)
{
foreach ($attributes as $name => $value) {
if (property_exists($this, $name)) {
@gpassarelli
gpassarelli / load_extensions
Created September 28, 2015 19:41
Load Doctrine Extensios
Doctrine\Common\Annotations\AnnotationRegistry::registerLoader('class_exists');
<?php
/*
* This file is part of ThraceDataGridBundle
*
* (c) Nikolay Georgiev <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Thrace\DataGridBundle\Doctrine\ORM;
@gpassarelli
gpassarelli / mautic_spool.sh
Created November 26, 2015 12:02
Mautic Spool Size
find app/spool/default -type f | wc -l
@gpassarelli
gpassarelli / vagrant_fix.sh
Created March 17, 2016 09:49
Vagrant up won't work
sudo /usr/lib/virtualbox/vboxdrv.sh setup
@gpassarelli
gpassarelli / phpstrom_keyboard.sh
Created March 17, 2016 09:50
PHPStorm Keyboard Stoped working
sudo ibus restart
@gpassarelli
gpassarelli / wl_dmi.html
Last active December 1, 2017 14:54
Best practices for DMI WL
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>White Label DMI</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Minimal CSS to make DMI White Label looks nice on desktop websites. We strongly reccomend to have a full width page for the WL -->
<style>