Skip to content

Instantly share code, notes, and snippets.

View sebahernandez's full-sized avatar

Sebaprogrammer sebahernandez

View GitHub Profile
@sebahernandez
sebahernandez / templateSlice.js
Created December 21, 2023 14:12 — forked from Klerith/templateSlice.js
Cascaron para crear Redux Slices rápidamente
import { createSlice } from '@reduxjs/toolkit';
export const templateSlice = createSlice({
name: 'name',
initialState: {
counter: 10
},
reducers: {
increment: (state, /* action */ ) => {
//! https://react-redux.js.org/tutorials/quick-start
@sebahernandez
sebahernandez / git-alias.md
Created June 16, 2022 02:08 — forked from Klerith/git-alias.md
Useful Git Alias

Log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

Status

git config --global alias.s status --short

Alternativa útil de status

git config --global alias.s status -sb

@sebahernandez
sebahernandez / wp-dropdown-menu-of-categories.php
Created November 24, 2020 02:56 — forked from luizventurote/wp-dropdown-menu-of-categories.php
Dropdown menu of categories with Walker.
<?php
# Walker Class
class my_Walker_CategoryDropdown extends Walker_CategoryDropdown {
function start_el(&$output, $category, $depth, $args) {
$pad = str_repeat('&nbsp;', $depth * 3);
$cat_name = apply_filters('list_cats', $category->name, $category);
<?php
/**
* Index File
* Template Name: Team Cards
*/
get_header(); ?>
<div class="grid-container">
<div class="grid-x grid-padding-x">
<?php
@sebahernandez
sebahernandez / wp-admin-select2.php
Created February 2, 2020 07:18 — forked from yanknudtskov/wp-admin-select2.php
Add select2 to all select fields in WordPress Admin
<?php
function enqueue_select2_jquery() {
wp_register_style( 'select2css', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.css', false, '1.0', 'all' );
wp_register_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.js', array( 'jquery' ), '1.0', true );
wp_enqueue_style( 'select2css' );
wp_enqueue_script( 'select2' );
}
add_action( 'admin_enqueue_scripts', 'enqueue_select2_jquery' );
@sebahernandez
sebahernandez / reset-rems
Created January 26, 2020 15:05 — forked from mrwweb/reset-rems
"Sanity-ize" REMs by setting them to 10px-baseline aka "Tiny Happy Pixels Dancing."
/* this is the "root" in "root em." */
html {
font-size: 62.5%; /* Now 10px = 1rem! */
}
body {
font-size: 16px; /* px fallback */
font-size: 1.6rem; /* default font-size for document */
line-height: 1.5; /* a nice line-height */
}
/*==================================================================
= CSS3 image slider with stylized thumbnails =
==================================================================*/
/**
*NEED BROWSER PREFIXES!!!!!!!!!!!
* <!--
We will make a slider with stylized thumbnails using CSS3
The markup is very simple:
Radio Inputs
Labels with thumbnails to detect click event