Skip to content

Instantly share code, notes, and snippets.

@luisfc
luisfc / doc.md
Created February 4, 2020 06:17 — forked from aloon/doc.md
Chuleta GIT

#GIT

Configuracion inicial

Global

git config --global user.name "Alex Gonzalez"
git config --global user.email miemail@domain.cat
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
@luisfc
luisfc / config.fish
Last active April 1, 2024 14:03
ANDROID_HOME environment variable - fish shell linux
## Android
set --export ANDROID_HOME $HOME/Android/Sdk
set -gx PATH $ANDROID_HOME/emulator $PATH;
set -gx PATH $ANDROID_HOME/tools $PATH;
set -gx PATH $ANDROID_HOME/tools/bin $PATH;
set -gx PATH $ANDROID_HOME/platform-tools $PATH;
# When finished run: source ~/.config/fish/config.fish
@luisfc
luisfc / mycustom_theme.theme
Created January 14, 2019 20:58
mycustom_theme d8
<?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')));
@luisfc
luisfc / Remove all images with JavaScript
Last active August 25, 2022 21:03
Remove all images with JavaScript
//#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]);
#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;
@luisfc
luisfc / Install Vagrant on Ubuntu 16.04 LTS
Created October 18, 2018 07:02
Install Vagrant on Ubuntu 16.04 LTS (Xenial Xerus)
# 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
@luisfc
luisfc / Upgrade Virtualbox 5.1 to 5.2 on Ubuntu
Last active October 18, 2018 06:37
Upgrade Virtualbox 5.1 to 5.2 on Ubuntu
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.
@luisfc
luisfc / LICENCE SUBLIME TEXT
Created July 8, 2018 22:40
Sublime Text 3 Serial key build is 3176
## 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 -----
@luisfc
luisfc / ContactForm-basic.php
Created June 18, 2018 01:24 — forked from WengerK/ContactForm-basic.php
Drupal 8 — Inline validation in forms
<?php
/**
* @file
* Contains \Drupal\my_contact\Form\ContactForm.
*/
namespace Drupal\my_contact\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
@luisfc
luisfc / install nodejs, npm and gulp
Last active October 3, 2020 16:37
Install nodejs, npm and gulp ubuntu 16.04
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