Skip to content

Instantly share code, notes, and snippets.

View rangel96's full-sized avatar

Eric Rangel rangel96

  • Jalisco, México
  • 06:34 (UTC -06:00)
  • X @ericran90
View GitHub Profile
@rangel96
rangel96 / img-effect-hover.html
Created April 11, 2023 01:22
Para crear un elemento con HTML y SCSS que contenga una imagen con un efecto hover para opacar la imagen y poner un texto centrado
<div class="image-container">
<img src="ruta-de-la-imagen" alt="Descripción de la imagen">
<div class="overlay">
<p>Texto centrado</p>
</div>
</div>
@rangel96
rangel96 / utils.service.ts
Last active February 21, 2023 19:05
Convert camelCaseText to Title Case Text
const cabeceras = [];
for (const jsonElementKey in json[0]) {
const result = jsonElementKey.replace(/([A-Z])/g, ' $1');
const finalResult = result.charAt(0).toUpperCase() + result.slice(1);
console.log(finalResult);
cabeceras.push(finalResult);
}
String pattern = r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
RegExp regExp = new RegExp(pattern);
@rangel96
rangel96 / dashboard.component.html
Last active January 3, 2023 23:15
Resize ngx-charts
<div class="col-sm-8" (window:resize)="onResize($event)">
<ngx-charts-pie-grid
[results]="dataListSinglePieGrid"
[view]="view"
></ngx-charts-pie-grid>
</div>
/**
* It creates a button, sets the button's type to 'button', sets the button's data-bs-toggle attribute to 'modal', sets
* the button's data-bs-target attribute to the targetName parameter, sets the button's style.visibility to 'hidden',
* adds the button to the document body, clicks the button, and then removes the button from the document body
* @param {string} targetName - The name of the modal you want to open.
*/
openModal(targetName: string): void {
const button = document.createElement('button');
button.type = 'button';
button.setAttribute('data-bs-toggle', 'modal');
@rangel96
rangel96 / crolleable.css
Last active June 16, 2023 16:52
Hacer scroll una sección del código
.container-grafica {
// min-width: 414px; // Display size
overflow: auto;
overflow-y: hidden;
white-space: nowrap;
position: relative;
-webkit-overflow-scrolling: touch;
}
.container-grafica .section {
@rangel96
rangel96 / Borderless Bootstrap.SCSS
Last active November 30, 2022 21:37
Quita el bordo
/* Borderless bootstrap */
.form-control {
-webkit-box-shadow: none;
box-shadow: none;
border: none;
font-size: 0.9em;
}
.form-control:focus {
-webkit-box-shadow: none;
@rangel96
rangel96 / git-alias.md
Created August 29, 2021 19:40 — 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