Skip to content

Instantly share code, notes, and snippets.

View ruby232's full-sized avatar

Rubisel Prieto Dupeyrón ruby232

View GitHub Profile
@ruby232
ruby232 / import.php
Created October 24, 2019 14:04 — forked from crittermike/import.php
Importing Drupal 8 config programmatically
<?php
// Import arbitrary config from a variable.
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html');
$config->setData($data)->save();
// Or, re-import the default config for a module or profile, etc.
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module');
// Or, import YAML config an arbitrary directory.
@ruby232
ruby232 / text
Created February 12, 2020 01:50 — forked from d1i1m1o1n/text
How to disable auto-save in phpstorm
How to disable auto-save:
Go to File > Settings (Ctrl+Alt+S).
Go to Appearance & Behavior > System Settings.
Make sure the two are unchecked:
Save files on frame deactivation
Save files automatically if application is idle for x sec.
Go to Editor > General > Editor Tabs
Put a checkmark on "Mark modified files with asterisk"
(Optional but recommended) Under "Tab Closing Policy", select "Close non-modified files first". You may also want to increase the number of allowed tabs.
Click Apply > OK.
@ruby232
ruby232 / countContainers.sh
Last active February 15, 2020 01:02 — forked from ggtools/countContainers.sh
A simple script to count the containers on a Docker host.
#!/bin/bash
function countContainers() {
docker ps -q $1 | wc -l
}
function countCrashedContainers() {
docker ps -a | grep -v -F 'Exited (0)' | grep -c -F 'Exited ('
}
@ruby232
ruby232 / provincias.json
Last active November 24, 2023 04:30 — forked from firomero/json
Provincias de Cuba
[
{
"id": "1",
"nombre": "Pinar del Río",
"municipios": [
"Consolación del Sur",
"Guane",
"La Palma",
"Los Palacios",
"Mantua",
@ruby232
ruby232 / README.md
Created June 26, 2020 16:31 — forked from Greg-Boggs/README.md
Drupal Site Building Best Practices

Better Drupal Building

  • Custom glue should be accomplished with configuration first and PHP code second.

Configuration Management and Dependencies

  • Use Composer (or Drush Make) to build your project and it's depencies.
  • Store your work in files.
  • Set your config directory above the webroot.
  • Sync UUIDs across all developers.

Theming

@ruby232
ruby232 / database.rules.json
Created November 20, 2020 20:47 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@ruby232
ruby232 / gitflow-breakdown.md
Created March 5, 2021 15:30 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@ruby232
ruby232 / menu-local-task.html.twig
Created October 13, 2021 18:17 — forked from blackice2999/menu-local-task.html.twig
Drupal 8 - How to add classes to link (render array) without using preprocess....
{#
/**
* @file
* Default theme implementation for a local task link.
*
* Available variables:
* - attributes: HTML attributes for the wrapper element.
* - is_active: Whether the task item is an active tab.
* - link: A rendered link element.
*
@ruby232
ruby232 / gist:098ac44df6c14971209c0fa8fb560860
Created November 16, 2022 12:18 — forked from rmetzler/gist:2947828
find all non UTF-8 encoded files
find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail
@ruby232
ruby232 / submit.md
Last active April 5, 2023 12:50 — forked from tanaikech/submit.md
Downloading Shared Files on Google Drive Using Curl

pip install gdown gdown 1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ

Downloading Shared Files on Google Drive Using Curl

When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.

File size < 40MB