Skip to content

Instantly share code, notes, and snippets.

View ClaudioVarandas's full-sized avatar

Cláudio Varandas ClaudioVarandas

  • Lisbon Portugal
  • 05:08 (UTC +01:00)
View GitHub Profile
#reset passwords
drush user-password admin --password=1234
@ClaudioVarandas
ClaudioVarandas / migrate.sh
Created September 16, 2016 23:10 — forked from pjmazenot/migrate-mamp-to-mysql-5.7.sh
Upgrade MAMP 3.5 to MySQL 5.7 tested 2016/09/17
#!/bin/sh
# Original by Ken Lin
# Updated by Pierre-Julien Mazenot
#
# - Mysql version 5.7.9 -> 5.7.11
# - Comments
#
# Additional notes after last tests
#
<?php
$ldaprdn = "uid=test,ou=test,dc=test,dc=test,dc=pt";
$ldappass = "xxx";
$basedn = "dc=test,dc=pt";
// if no ldap.conf or ldaprc configured, need to put certificate in environment
putenv('LDAPTLS_CACERT=./ca.pem');
//Enable debug
composer create-project drupal/drupal project-name 8.1.*
composer config repositories.drupal composer https://packages.drupal.org/8
drush si standard --db-url='mysql://[user]:[pass]@localhost/[db_name]' --site-name=xxx --account-name=admin --account-pass=9999
### Drupal Commerce
composer require "drupal/commerce 2.x-dev"
drupal module:install commerce_product commerce_checkout commerce_cart commerce_tax
#Remove all docker containers with status exited
$ docker rm -v $(docker ps -a -q -f status=exited)
@ClaudioVarandas
ClaudioVarandas / CheckSecurity.php
Last active February 6, 2016 12:08
CheckSecurity Command for Laravel 5
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use SensioLabs\Security\SecurityChecker;
class CheckSecurity extends Command
{
/**
@ClaudioVarandas
ClaudioVarandas / clean_empty_input_value
Created September 10, 2015 09:35
remove empty value from imput
<?php
$data = array_filter($data, function ($value) {
return $value !== '';
});
@ClaudioVarandas
ClaudioVarandas / ApiController
Last active September 8, 2015 13:51
ApiController - Base api controller
<?php
namespace Api\v1;
use Apilog;
use Config;
use Input;
use League\Fractal;
use League\Fractal\Pagination\Cursor;
use League\Fractal\Resource\Collection;
vagrantfile:
target: local
vm:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
hostname: cvhomevag
memory: '2048'
cpus: '2'
chosen_provider: virtualbox
network:
@ClaudioVarandas
ClaudioVarandas / remove_git_files.sh
Created August 23, 2015 17:29
Remove git files from project
find . | grep .git | xargs rm -rf