This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyCLI is a command line interface for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting. | |
sudo apt-get install mycli | |
Used examples: | |
$ mycli local_database | |
$ mycli -h localhost -u root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taxonomy terms: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
# Menu links: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
# File items: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
# Nodes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install nodejs | |
sudo apt-get install npm | |
## Use n module from npm in order to upgrade node | |
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains \Drupal\my_contact\Form\ContactForm. | |
*/ | |
namespace Drupal\my_contact\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormStateInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Sublime Text 3 Serial key build is 3176 | |
> * Added these lines into /etc/hosts | |
127.0.0.1 www.sublimetext.com | |
127.0.0.1 license.sublimehq.com | |
> * Used the license key | |
----- BEGIN LICENSE ----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to install VirtualBox 5.2 on Ubuntu | |
#Open a terminal "Ctrl + Alt + t" and remove Virtualbox 5.1. | |
sudo apt remove virtualbox virtualbox-5.1 | |
#Debian-based Linux distributions | |
#Add a new repository | |
#According of the distribution, replace '<mydist>' with 'artful', 'zesty', 'yakkety', 'xenial', 'trusty', 'stretch', 'jessie', or 'wheezy' (older versions of VirtualBox supported different distributions) | |
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian <mydist> contrib" >> /etc/apt/sources.list.d/virtualbox.list' | |
or add in /etc/apt/sources.list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove the older version of vagrant. | |
sudo apt-get remove --auto-remove vagrant | |
rm -r ~/.vagrant.d | |
#Download Vagrant package and install it manually. | |
#Vagrant download page provides the latest version of Vagrant | |
https://www.vagrantup.com/downloads.html | |
#This example used debian package x86_64 | |
1. wget https://releases.hashicorp.com/vagrant/2.2.0/vagrant_2.2.0_x86_64.deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Nginx.conf file | |
server { | |
listen 80; | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name site.local; | |
ssl_certificate /etc/ssl/certs/site.local.crt; | |
ssl_certificate_key /etc/ssl/private/site.local.key; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#1 | |
var images = document.getElementsByTagName('img'); | |
var l = images.length; | |
for (var i = 0; i < l; i++) { | |
images[0].parentNode.removeChild(images[0]); | |
} | |
//#2 | |
for (var i= document.images.length; i-->0;) | |
document.images[i].parentNode.removeChild(document.images[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Functions to support theming in the Pattern Lab theme. | |
*/ | |
function mycustom_theme_preprocess_page(array &$variables) { | |
// Prepare the intro values | |
$variables['intro_logo'] = file_url_transform_relative(file_create_url(theme_get_setting('intro_logo', 'mycustom_theme'))); |