Skip to content

Instantly share code, notes, and snippets.

View erighetto's full-sized avatar

Emanuel Righetto erighetto

View GitHub Profile
@erighetto
erighetto / recipe
Created March 27, 2021 16:44 — forked from magdmartin/recipe
OpenRefine recipe to parse Apache log
[
{
"op": "core/column-split",
"description": "Split column Column 1 by separator",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Column 1",
"guessCellType": true,
<?php
$entities = array_keys(\Drupal::entityTypeManager()->getDefinitions());
sort($entities);
foreach ($entities as $entity) {
$current_field_storage_definitions = \Drupal::entityManager()->getFieldStorageDefinitions($entity);
\Drupal::service('entity.last_installed_schema.repository')
->setLastInstalledFieldStorageDefinitions($entity, $current_field_storage_definitions);
#!/bin/bash
brew update
brew upgrade
brew cask upgrade
brew cleanup -s
# Ignore configuration files that may contain sensitive information.
/sites/*/settings*.php
/.htpasswd
# Ignore the boost cache
/cache
/cache/*
# Ignore the files
/sites/*/files
@erighetto
erighetto / docker-killer.sh
Created October 16, 2016 11:45
stop & remove container + remove volume
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) && docker volume rm $(docker volume ls -qf dangling=true)
@erighetto
erighetto / docker-compose.yml
Last active December 19, 2018 22:49
Docker compose file demo suitable for Drupal local development with PHP 7 and MariaDB 10
version: '3'
services:
web-app:
image: erighetto/drupal-dev:latest
ports:
- "80:80"
depends_on:
- dbserver
links:
@erighetto
erighetto / settings.local.php
Last active February 5, 2018 05:50
Drupal 8 Local development override configuration feature
<?php
/**
* @file
* Local development override configuration feature.
*/
/**
* Assertions.
*
* The Drupal project primarily uses runtime assertions to enforce the
@erighetto
erighetto / print_zpl.php
Last active June 16, 2022 16:06
Send raw ZPL to Zebra printer
<?php
error_reporting(E_ALL);
/* Get the port for the service. */
$port = "9100";
/* Get the IP address for the target host. */
$host = "172.17.144.89";
/* construct the label */
@erighetto
erighetto / services.local.yml
Last active February 5, 2018 05:50
Drupal 8 services for development
# @file
# Local development services.
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
parameters:
twig.config:
debug: true
cache: false
@erighetto
erighetto / functions.php
Last active January 3, 2016 16:29
Displaying recent posts in WordPress with WPML plugin
<?php
function icl_get_recent_posts($limit = 10, $language) {
global $wpdb;
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if (is_plugin_active('sitepress-multilingual-cms/sitepress.php')) {
$querystr = "
SELECT wposts.*
FROM {$wpdb->prefix}posts wposts, {$wpdb->prefix}icl_translations icl_translations
WHERE wposts.ID = icl_translations.element_id