Skip to content

Instantly share code, notes, and snippets.

View lcube45's full-sized avatar
🏌️‍♂️
Focusing

lcube lcube45

🏌️‍♂️
Focusing
View GitHub Profile
@lcube45
lcube45 / template.php
Last active August 25, 2016 09:59
Remove panels separator panes
function themename_panels_default_style_render_region($vars) {
$output = '';
$output .= implode('', $vars['panes']);
return $output;
}
@lcube45
lcube45 / example.module
Last active August 25, 2016 10:20
Drupal theme function for generating a bootstrap grid of nodes
/**
* Implements hook_theme()
*/
function example_theme() {
return array(
'bootstrap_grid' => array(
'render element' => 'elements'
),
);
}
@lcube45
lcube45 / embed_form.php
Last active September 28, 2016 13:25
Drupal 7 - embed node form
function my_custom_form_callback($type = 'page') {
global $user;
module_load_include('inc', 'node', 'node.pages');
$node = (object) array(
'uid' => $user->uid,
'name' => (isset($user->name) ? $user->name : ''),
'type' => $type,
'language' => LANGUAGE_NONE
);
$form = drupal_get_form($type . '_node_form', $node);
@lcube45
lcube45 / behat.yml
Created October 10, 2016 15:02
Behat Starter Kit
default:
extensions:
Behat\MinkExtension:
base_url: "<url>"
default_session: selenium2
goutte: ~
selenium2:
wd_host: http://127.0.0.1:4444/wd/hub
browser: chrome
capabilities:
@lcube45
lcube45 / FeatureContext.php
Created October 10, 2016 15:04
Behat : add screenshot on error
<?php
class FeatureContext extends MinkContext {
/**
* Take screenshot when step fails. Works only with Selenium2Driver.
* Screenshot is saved at [Date]/[Feature]/[Scenario]/[Step].jpg
*
* @AfterStep @javascript
*/
@lcube45
lcube45 / drupal.bat
Created November 7, 2016 11:32
Drupal console install on windows
@php "%~dp0drupal.phar" %*
@lcube45
lcube45 / Sqlpgsql.php
Created May 11, 2017 12:25
Drush with PostGreSql on Windows
<?php
namespace Drush\Sql;
define('PSQL_SHOW_TABLES', "SELECT tablename FROM pg_tables WHERE schemaname='public';");
class Sqlpgsql extends SqlBase {
//public $query_extra = "--no-align --field-separator=\"\t\" --pset tuples_only=on";
public $query_extra = "--no-align --pset tuples_only=on";
@lcube45
lcube45 / docker-compose.yml
Created January 18, 2019 13:11
gitlab docker compose
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
# Add any other gitlab.rb configuration here, each on its own line
ports:
- '80:80'
@lcube45
lcube45 / docker-compose.yml
Created January 18, 2019 13:12
phabricator docker compose
version: '2'
services:
mariadb:
image: 'bitnami/mariadb:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- 'mariadb_data:/bitnami'
phabricator:
image: 'bitnami/phabricator:latest'
@lcube45
lcube45 / docker-compose.yml
Created January 18, 2019 13:13
tuleap docker compose
version: "2.1"
services:
tuleap:
image: enalean/tuleap-aio
restart: unless-stopped
environment:
VIRTUAL_HOST: "${VIRTUAL_HOST:-localhost}"
DB_HOST: "db"
MYSQL_ROOT_PASSWORD: "tuleap"