Skip to content

Instantly share code, notes, and snippets.

View franckweb's full-sized avatar

Franck Mercado franckweb

  • Globant
  • Cusco, Perú
View GitHub Profile
FROM php:7.0.4-fpm
RUN apt-get update && apt-get install -y libmcrypt-dev \
mysql-client libmagickwand-dev --no-install-recommends \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-install mcrypt pdo_mysql
@franckweb
franckweb / install.sh
Created September 20, 2017 16:49 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@franckweb
franckweb / lxde-rc.xml
Created October 8, 2017 03:11
LXDE configuration shortcuts file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
@franckweb
franckweb / docker-compose.yml
Last active October 27, 2017 21:18
Selenium Grid in Docker compose file with WebDriver for Firefox and Chrome
version: '2'
services:
seleniumhub:
container_name: seleniumhub
image: selenium/hub
ports:
- "4444:4444"
@franckweb
franckweb / sql-queries.sql
Last active December 14, 2017 16:42
SQL Queries
## EXPLAIN SQL function
# https://dev.mysql.com/doc/refman/5.7/en/using-explain.html
# https://www.sitepoint.com/using-explain-to-write-better-mysql-queries/
@franckweb
franckweb / vim-plugins.sh
Last active April 5, 2018 18:56
Vim Plugins
# VIM PLUGINS
## Install Pathogen (vim plugins manager)
mkdir -p ~/.vim/autoload ~/.vim/bundle;
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
## Create ~/.vimrc and add these contents
" contents of minimal .vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
@franckweb
franckweb / woocommerce-functions.php
Created June 28, 2018 20:34
Personalized woocommerce for wordpress
/*
* Personalized sorting options
*/
add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' );
function custom_woocommerce_get_catalog_ordering_args( $args ) {
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );
$fallback = apply_filters( 'wc_extra_sorting_options_fallback', 'title', $orderby_value );
$fallback_order = apply_filters( 'wc_extra_sorting_options_fallback_order', 'ASC', $orderby_value );
@franckweb
franckweb / automate-virtualmin.ssh
Created October 6, 2018 15:05
Move non-Virtualmin accounts into Virtualmin transferring data and databases
# Move non-Virtualmin accounts into Virtualmin transferring data and databases
# When its done update config files
# TODO: automate the updating of common config files
# Connects to the destination server to create the Virtualmin server
#Then connects to the source to move files and databases across
set -e
# New Site Settings
@franckweb
franckweb / helpful-scripts.sh
Last active November 20, 2018 03:20
Helpful scripts
## VIM usage
# to delete all lines in a file
:1,$d
## SUBLIME Tabs
{ "keys": "ctrl+pagedown", "command": "next_view_in_stack" },
{ "keys": "ctrl+pageup", "command": "prev_view_in_stack" },
{ "keys": ["ctrl+tab"], "command": "next_view" },
@franckweb
franckweb / polylang_stuff.php
Last active January 21, 2019 02:45
Polylang
<?php
/* language switcher */
$translations = pll_the_languages( array(
'show_flags' => 0,
'hide_if_no_translation' => 1,
'hide_current'=> 1,
'raw' => 1)
);
if (count($translations) > 0){