Skip to content

Instantly share code, notes, and snippets.

Ivan H. ivanxuu

Block or report user

Report or block ivanxuu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ivanxuu
ivanxuu / docker_prestashop_1.7.md
Created Jul 23, 2019
Chuleta prestashop 1.7 generar docker
View docker_prestashop_1.7.md
$ sudo docker network create old-prestashop-tier
$ sudo docker volume create --name old_mariadb_data
$ sudo docker run -d --name oldmariadb \
-e ALLOW_EMPTY_PASSWORD=yes \
-e MARIADB_USER=bn_prestashop \
-e MARIADB_DATABASE=old_prestashop \
--net old-prestashop-tier \
--volume old_mariadb_data:/oldprestashop \
bitnami/mariadb:latest
$ sudo docker volume create --name old_prestashop_data
@ivanxuu
ivanxuu / Vagrantfile
Created Jan 5, 2018
Deploy elixir cluster using vagrant as an example
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
View phoenix.chuleta.md

ASSETS

Como añadir una librería de JS a phoenix?

  1. Instala la dependencia con assets/$ npm install --save jquery

  2. El fichero package.json se actualizará

  3. Puede que necesites cambiar el fichero brunch-config.js. Por ejemplo con jQuery si necesitas el $ disponible en todos los sitios

    npm: { enabled: true,

@ivanxuu
ivanxuu / Deploy elixir using distillery and edeliver
Last active Oct 1, 2018
How to deploy elixir using distillery and edeliver with a production machine in vagrant
View Deploy elixir using distillery and edeliver
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@ivanxuu
ivanxuu / context_helpers.ex
Created Oct 24, 2017
context setup functions elixir
View context_helpers.ex
defmodule HappoWeb.ContextHelpers do
@moduledoc """
# SETUP FUNCTIONS
#
# Example: setup [:fun_one, :fun_two]
#
# These functions help to prepare a test before execution. They
# receive a map with the context, returns `{:ok, new_context}`, and are
# chainable between them.
#
View cambios-comemejor.md

Ultimos cambios en comemejor

  • Añadida pagina de changelog (09/06/2017). Página que muestra las últimas modificaciones en la web de comemejor
  • Columna de planificador de recetas en la pagina de recetas (08/06/2017). Esta columna permite añadir las recetas al planificador a la vez que estan visibles en la pantalla.
@ivanxuu
ivanxuu / geolocate pics using exiftool
Created Jan 25, 2016
geolocate pics using exiftool
View geolocate pics using exiftool
exiftool -geotag track.gpx *.JPG
@ivanxuu
ivanxuu / rename-pics.sh
Last active Feb 6, 2016
rename pictures using exiftool conditionaly for geolocated pictures
View rename-pics.sh
#!/usr/bin/env sh
if [ -f "$1" ] ; then
echo "Geotaging non geolocated pictures"
# Find only non geolocated pictures
exiftool -geotag $1 -overwrite_original -if 'not $gpslongitude' *
else
echo "Skiping geolocating picture due to not track provided."
echo " Provide track with 'renamepics.sh track.gpx'\n"
fi
echo "\nRenaming pictures"
@ivanxuu
ivanxuu / conversor-img-prestashop.sh
Last active Jan 15, 2018
Conversor imagenes prestashop
View conversor-img-prestashop.sh
for pic in *.jpg; do
convert "${pic}" -interlace Plane -sampling-factor 4:2:0 -quality 84% -strip -resize 225x137 "${pic%.*}-home.jpg"
convert "${pic}" -interlace Plane -sampling-factor 4:2:0 -quality 84% -strip -resize 355x216 "${pic%.*}-large.jpg"
convert "${pic}" -interlace Plane -sampling-factor 4:2:0 -quality 84% -strip -resize 115x66 "${pic%.*}-medium.jpg"
convert "${pic}" -interlace Plane -sampling-factor 4:2:0 -quality 84% -strip -resize 1200x732 "${pic%.*}-category.jpg"
convert "${pic}" -interlace Plane -sampling-factor 4:2:0 -quality 84% -strip -resize 70x70 "${pic%.*}-small.jpg"
convert "${pic}" -interlace Plane -sampling-factor 4:2:0 -quality 84% -strip -resize 1200x732 "${pic%.*}-thickbox.jpg"
done
@ivanxuu
ivanxuu / jruby_opts
Last active Aug 29, 2015
jruby options for faster startup time
View jruby_opts
vim ~/.rvm/hooks/after_use_jruby_custom
#!/usr/bin/env bash
\. "${rvm_path}/scripts/functions/hooks/jruby"
if [[ "${rvm_ruby_string}" =~ "jruby" ]]
then
jruby_options_append "-Xcompile.invokedynamic=false -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify -Xcompile.mode=OFF"
else
You can’t perform that action at this time.