Skip to content

Instantly share code, notes, and snippets.

@eduardoarandah
eduardoarandah / add_contact_form_7_custom_tag.php
Created December 13, 2018 03:22
Adding A Custom Form-Tag to Contact Form 7 in Wordpress
<?php
/**
* Contact form 7
* custom tag: [posts show:12]
* show parameter is optional
*/
add_action('wpcf7_init', 'custom_add_form_tag_posts');
function custom_add_form_tag_posts()
{
@eduardoarandah
eduardoarandah / AutoHotkey.ahk
Last active June 4, 2024 13:09
Cómo usar Acentos y Ñ en teclado inglés con AutoHotkey
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Caracteres en español usando CapsLock
; Presionar CapsLock mas la vocal para acentuarla
; Para la ñ se puede usar la n o la tecla ; (porque ahí estaba la ñ originalmente)
; Para la ¿ usamos CapsLock y la tecla que tiene actualmente el ?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; mapear la n como ñ
CapsLock & n::
If GetKeyState("Shift", "P")
@eduardoarandah
eduardoarandah / gist:25d413bd693740a32f20eb6e691e5427
Last active January 22, 2020 20:32
How to change php version in apache2 and php cli in ubuntu 18
# Apache
sudo a2dismod php7.1
sudo a2enmod php7.3
sudo service apache2 restart
# Command Line
sudo update-alternatives --set php /usr/bin/php7.3
sudo update-alternatives --set phar /usr/bin/phar7.3
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.3
sudo update-alternatives --set phpize /usr/bin/phpize7.3
@eduardoarandah
eduardoarandah / .vimrc
Last active February 2, 2021 17:37
Mi configuración .vimrc y coc-settings.json
scriptencoding utf-8 " basic
set nocompatible " basic
filetype off " basic
filetype plugin on " Enable filetype plugins
filetype indent on " Enable loading the indent file for specific file types
syntax enable " Enable syntax highlighting
set encoding=utf-8 " Encoding (needed in youcompleteme)
set fileencoding=utf-8 " The encoding written to file.
set noerrorbells " No annoying sound on errors
set number " Line numbers on
@eduardoarandah
eduardoarandah / .tmux.conf
Last active June 16, 2022 01:52
Tmux configuration to work nicely with vim
# Reload tmux config
bind r source-file ~/.tmux.conf
# one of these should work:
# set -g default-terminal tmux-256color
# set -g default-terminal xterm-256color
# neovim :checkhealth suggests
set -g default-terminal screen-256color
set-option -sa terminal-overrides ',xterm-256color:RGB'
@eduardoarandah
eduardoarandah / .localrc
Created June 3, 2020 20:46
Comandos para agregar un vhost con nginx y php
# Variables necesarias en tu entorno
W='/home/lalo/www'
VHOSTS_NGINX='/etc/nginx/sites-enabled'
USER_LOCAL='lalo'
@eduardoarandah
eduardoarandah / .vim
Created June 30, 2020 22:44
Prefix tailwind classes using vim command
" this is the command used in this video: https://www.youtube.com/watch?v=YnaCMqSOYEA
" put it in register q with "qyiW
" Execute with :g/className/norm@q
" Dont forget to add keyword separators :set iskeyword+=- :set iskeyword+=:
0/className^Mf=llvi"^[:s/\%V\</tw-^M
@eduardoarandah
eduardoarandah / .bashrc
Last active July 7, 2020 15:53
jslive optionalfilename.js Javascript Live Editing environment with tmux and vim. Opens tmux with vim in the left, nodemon in the right
# jslive [yourfile.js]
# Test your javascript in a live reload environment
# Opens tmux with vim in the left, nodemon in the right
# Requires tmux and nodemon npm install -g nodemon
function jslive () {
# $# is args number
if [ $# -eq 0 ] && file=tmp.js || file=$1
# Create file
touch $file
# split with tmux, left is vim, right is node
@eduardoarandah
eduardoarandah / covid.js
Created July 7, 2020 16:35
Monitor de coronavirus que obtiene datos del sitio oficial de gobierno https://coronavirus.gob.mx/datos/
var fetch = require('node-fetch');
async function activos(claveMunicipio) {
let response = await fetch('https://coronavirus.gob.mx/datos/Overview/info/getInfo.php', {
headers: {
accept: '*/*',
'accept-language': 'es,es-ES;q=0.9,en;q=0.8',
'cache-control': 'no-cache',
'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryWUKVwTBDWw1CIYBb',
pragma: 'no-cache',
@eduardoarandah
eduardoarandah / .vimrc
Last active July 9, 2020 23:08
neovim easy buffer movement. FZF floating window and vim airline to see them
" This mapping combination with FZF feels great!
" See how this works: https://gfycat.com/wellgroomedofficialblueandgoldmackaw
" Buffers change with index and middle
nnoremap <C-j> :bn<CR>
nnoremap <C-k> :bp<CR>
" Index finger to filter lines in all buffers with jump to line
nnoremap <leader>j :Lines<CR>