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 / nginx-symfony3.conf
Last active March 7, 2019 16:02
Nginx symfony 3 y fpm-php 7
# /etc/nginx/sites-enabled/
server {
server_name domain.tld www.domain.tld;
root /var/www/project/web;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}
# DEV
@ruby232
ruby232 / ImportTranslations.php
Created March 14, 2018 14:31
Import Translations in Drupal 8 programmatically.
function importTranslations( array $poFiles) {
\Drupal::moduleHandler()->loadInclude('locale', 'translation.inc');
\Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
$opt_langcode = 'es';
$opt_set_customized = TRUE;
$opt_replace_customized = TRUE;
$opt_replace_not_customized = TRUE;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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