Skip to content

Instantly share code, notes, and snippets.

View josecaos's full-sized avatar
👹
filling squares

Jose Carlos Hasbun josecaos

👹
filling squares
View GitHub Profile
@josecaos
josecaos / change-wp-prefix
Created May 8, 2024 21:50
Change the WP database Prefix
### How to change WP Prefix
- Change prefix in wp-config.php file
'''
$table_prefix = 'new_prefix';
'''
- In phpmyadmin
- Select the database.
- Check on the ‘check all’ checkbox to select all tables.
@josecaos
josecaos / opengraph-twittercards.txt
Last active April 30, 2024 00:12
Twitter Cards - Open Graph
// X cards
<meta name=”twitter:card” content=”summary” />
<meta name=”twitter:site” content=”@yoursite” />
<meta name=”twitter:title” content=”Your Title” />
<meta name=”twitter:description” content=”Your description.” />
<meta name=”twitter:image” content=”https://where-your-image-is-hosted/name.jpg” />
// Open Graph
<meta property="og:title" content="Título de tu artículo o página">
<meta property="og:description" content="Descripción del contenido">
@josecaos
josecaos / gist:f74d2e3e53c55bbf718baa8b736c6f00
Created June 27, 2023 23:56
GIT: Ignorar archivos que ya han sido agregados al caché
# GIT: Ignorar archivos que ya han sido agregados al caché
### Borra el archivo de la caché
```
git rm -r --cached ruta/de/archivo
```
@josecaos
josecaos / Add user to group
Created April 17, 2023 21:10
In case symlinks are not working in apache localhost folder (html)
sudo usermod -g www-data <YOUR_USERNAME>
@josecaos
josecaos / Custom WP Permalinks in localhost
Created April 3, 2023 21:02
Allow Custom Permalinks in WP localhost enviroment
@josecaos
josecaos / webpack.config.js
Created August 14, 2020 01:12
webpack CCD
const webpack = require('webpack');
const path = require('path');
const config = require('sapper/config/webpack.js');
const pkg = require('./package.json');
const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const alias = { svelte: path.resolve('node_modules', 'svelte') };
const extensions = ['.mjs', '.js', '.json', '.svelte', '.html'];
@josecaos
josecaos / css.dotted.pattern.overlay
Created October 31, 2019 01:44
css.dotted.pattern.overlay
css-dotted-pattern-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABhJREFUeNpiYmBgaPj//z8DI4gAAYAAAwBABgZ+pgNS5QAAAABJRU5ErkJggg==);
z-index: -1;
background-size: 2px;
}
@josecaos
josecaos / js.debug.log.md
Last active September 29, 2019 19:04
Usos comunes de la consola con JS

consola js

// retorna la variable que lo contiene
console.log({foo,bar,baz})
// regresa una tabla
console.log([foo,bar,baz])
// %c relaciona estilos con la consola
console.log('%c DEBUGGING COLOR','color:lime;')
// tiempos de ejecucion
console.time('looper')
@josecaos
josecaos / arregla.permisos.docker.ubuntu.txt
Created August 23, 2019 19:32
Arragla permisos de docker
How to fix docker ‘Got permission denied while trying to connect to the Docker daemon socket’
Problem:
You are running a command like docker ps but you get this error message:
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/json: dial unix /var/run/docker.sock: connect: permission denied
Solution:
As a quick fix, running the command as root using sudo (e.g. sudo docker ps) will solve the issue temporarily.
@josecaos
josecaos / js.copy.all.inside.some.div.html
Last active March 7, 2019 19:55
Copy all content from div
<div id="htmlcode" onclick="selectContent()">XXXXXXXXXXXXX</div>
<style>
function selectContent() {
const node = document.getElementById('htmlcode')
if (document.body.createTextRange) {
const range = document.body.createTextRange()
range.moveToElementText(node)
range.select()
document.execCommand('copy')