Skip to content

Instantly share code, notes, and snippets.

View sergixnet's full-sized avatar

Sergio Peña sergixnet

View GitHub Profile
@sergixnet
sergixnet / optipng
Created May 9, 2018 08:56
optipng recursively optimize png on folders and subfolders
find . -type f -iname "*.png" -print0 | xargs -I {} -0 optipng -o5 -quiet -keep -preserve -log optipng.log "{}"
@sergixnet
sergixnet / docker-compose-2.yml
Last active May 7, 2018 19:41
compose-assigment-2
version: '2'
services:
drupal:
image: custom-drupal
build: .
ports:
- "8080:80"
volumes:
- drupal-modules:/var/www/html/modules
@sergixnet
sergixnet / .gitconfig
Last active April 25, 2018 15:28
git alias
[user]
name = my name
email = example@gmail.com
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@sergixnet
sergixnet / .vimrc
Last active October 7, 2018 17:14
personal .vimrc, color scheme https://github.com/tomasiser/vim-code-dark
set nocompatible
set autoindent
set clipboard=unnamedplus " using the X Window clipboard
" colors
colorscheme codedark " color scheme
syntax enable
set background=dark
set t_Co=256
@sergixnet
sergixnet / minify-plugin-activated.html
Last active April 18, 2018 07:26
The page is broken when Minify HTM plugin is activated, when the page is disabled it works well.
.gist table{table-layout:auto}</style><script src="/user/themes/drminsky/dist/js/vendor/lazysizes.min.js" async></script><script src="/system/assets/jquery/jquery-2.x.min.js"></script><script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script><script>(function(e,a,i,s,o,t,n){e['GoogleAnalyticsObject']=o;e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date();t=a.createElement(i),n=a.getElementsByTagName(i)[0];t.async=1;t.src=s;n.parentNode.insertBefore(t,n)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create','UA-26639219-1','auto');ga('send','pageview');window.addEventListener('load',function(){window.cookieconsent.initialise({'palette':{'popup':{'background':'#4A4A4A','text':'#E2E2E2'},'button':{'background':'#F32ED4','text':'#fff','border':'#f1d600'}},'position':'bottom','theme':'classic','content':{'message':' En cumplimiento con Ley 34/2002 de servicios de la sociedad de la información, le recordamos que al na
Backup: sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/boot --one-file-system /
Restore: sudo tar -xvpzf /path/to/tar/file -C / --numeric-owner
@sergixnet
sergixnet / custom_the_content.php
Created July 17, 2017 09:53 — forked from mathetos/custom_the_content.php
Adding Custom Class to the_content
<?php
//Adding custom class to posts is easy with the post_class filter
add_filter('post_class', 'custom_content_class');
function custom_content_class($classes) {
$classes[] = 'custom_class';
return $classes;
}
@sergixnet
sergixnet / bitbucket-pipelines.yml
Created May 17, 2017 10:01
Bitbucket pipelines
# You can specify a custom docker image from Docker Hub as your build environment.
image: samueldebruyn/debian-git
pipelines:
default:
- step:
script:
- apt-get update
- apt-get -qq install git-ftp
- git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://youtftpsite.com/ftp-path/
# for the second push run this command instead of init
@sergixnet
sergixnet / yt-mp3
Created March 7, 2017 17:41
Download a youtube playlist in mp3
youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/playlist?list=<LIST_ID>
@sergixnet
sergixnet / json2yaml-md.py
Created February 14, 2017 16:07
Creating a markdown file from a dictionary, for use in Grav cms
# -*- coding: utf-8 -*-
import yaml
import html2text
import os
ROOT_DIR = os.getcwd()
dic = {
'title': 'My awesome title',