Skip to content

Instantly share code, notes, and snippets.

@smarulanda97vmlyr
smarulanda97vmlyr / multiple_ssh_setting.md
Created August 24, 2021 14:38 — forked from RichardBronosky/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@smarulanda97vmlyr
smarulanda97vmlyr / mysql-docker.sh
Created August 21, 2021 02:42 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@smarulanda97vmlyr
smarulanda97vmlyr / clean-up-arch-linux.md
Created July 21, 2021 05:05 — forked from rumansaleem/clean-up-arch-linux.md
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@smarulanda97vmlyr
smarulanda97vmlyr / LoadTaxonomyTermsTrait.php
Created January 27, 2021 16:29
Drupal 8, 9 - Trait that contains a generic method for load terms of taxonomy and returns an array with the common properties of the term. Also, it's possible to load the value of the custom fields of taxonomy.
<?php
/**
* @file contains \Drupal\africa_tanzania_base\Trait\LoadTermsTrait;
*/
namespace Drupal\africa_tanzania_base;
use Drupal\taxonomy\TermInterface;
use Drupal\Core\TypedData\Exception\MissingDataException;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
@smarulanda97vmlyr
smarulanda97vmlyr / module.install
Created January 27, 2021 15:07 — forked from Erikdekamps/module.install
Drupal 8 - Load taxonomy terms sorted by weight
/**
* Get taxonomy terms sorted by weight.
*
* @param int $vid
* The vocabulary id.
*
* @return array
* Returns an array of term id | name.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException