Skip to content

Instantly share code, notes, and snippets.

@mbriceno
mbriceno / HTML
Created February 1, 2023 20:38
Dada un fecha en formato d-mmmm-yyyy, se debe hacer un GET a la siguiente API
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
Date.prototype.addDays = function(days) {
var date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
}
const getStockInformation = async (range) => {
@mbriceno
mbriceno / PHP
Created February 1, 2023 19:42
Algoritmo en PHP Dados los conceptos que indican hora de inicio y hora de fin de las horas ordinarias (HO), horas extras (HED) y horas extras nocturnas (HEN), se requiere determinar el total de horas ordinarias (HO), horas extras (HED) y horas extras nocturnas (HEN) laboradas por un empleado de acuerdo con las marcaciones de entrada y salida.
function classifyAttendances($concepts, $attendanceIn, $attendanceOut) {
$concepts = json_decode($concepts);
$attendanceIn = strtotime($attendanceIn);
$attendanceOut = strtotime($attendanceOut);
$response = [];
foreach ($concepts as $key => $value) {
$start = strtotime($value->start);
$end = strtotime($value->end);
if (($attendanceIn >= $start && $attendanceIn <= $end)) {
@mbriceno
mbriceno / nuxt.config.js
Created January 3, 2023 20:48 — forked from steveyerigandev/nuxt.config.js
Nuxt.js - the best approach to optimize the webpage ( using purgeCSS, splitchunk, cache, offline )
require('dotenv').config();
module.exports = {
/*
** Headers of the page
*/
head: {
htmlAttrs: {
lang: 'de',
},
@mbriceno
mbriceno / .deps...remix-tests...remix_accounts.sol
Created May 13, 2022 21:57
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.6+commit.7338295f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;
public static function makeId()
{
$app = JFactory::getApplication();
// Get url parameters set by plugins
if(!empty($app->registeredurlparams))
{
$registeredurlparams = $app->registeredurlparams;
}
@mbriceno
mbriceno / gist:3936100
Created October 23, 2012 01:20
cambio para joomla
// Get url parameters set by plugins
if(!empty($app->registeredurlparams))
{
$registeredurlparams = $app->registeredurlparams;
}
// Platform defaults
if(){}
<a href="<?php echo get_post_meta( get_the_ID(), 'linkp', true ); ?>" > <?php the_title(); ?> </a>
.caja-mentores{
.....
/*Agregar al final de esta clase*/
position: relative;
text-align: center;
}
.inner-mentores{
display: inline-block;
max-width: 1125px;
<div class="wrap-noticias">
<div class="lean-cavas">
Esto no debe ser un div con background-imagen sino un div q tiene dentro un <img> con la imagen en el src
</div>
<div class="taller-cont">
<div class="texto-varios">
<div class="tits-azules">
<p>LEAN CAVAS</p>
</div>
<div class="texto">