Skip to content

Instantly share code, notes, and snippets.

View sytabaresa's full-sized avatar

Sebastian Tabares Amaya sytabaresa

View GitHub Profile
import dayjs from 'dayjs';
import minMax from 'dayjs/plugin/minMax.js'
dayjs.extend(minMax);
function findDifference(list1, list2) {
const result = {};
// Loop through each range in list1
while (list1.length > 0) {
const range1 = list1.pop()
@sytabaresa
sytabaresa / calendar.tsx
Created June 22, 2024 01:41
Tailwindcss - daisyUI calendar component with dayjs as datetime library
import { useTranslation } from "@refinedev/core"
import { FaChevronLeft, FaChevronRight } from "react-icons/fa6"
import dayjs from "dayjs";
import weekday from "dayjs/plugin/weekday";
import weekOfYear from "dayjs/plugin/weekOfYear";
import { HTMLAttributes, useEffect, useState } from "react";
dayjs.extend(weekOfYear);
function getNumberOfDaysInMonth(year: string, month: string) {
inactive
TEXT -> active
active
wellcome
NOMBRE -> userData
userData
lastName
APELLIDO -> tyc
tyc
ACEPTAR -> identity
@sytabaresa
sytabaresa / machine.js
Last active October 26, 2019 17:26
Generated by XState Viz: https://xstate.js.org/viz
const { cancel } = actions
const playerMachine = Machine(
{
id: 'player',
initial: 'idle',
context: {
promotion: 0,
promotionCounter: 0
},
@sytabaresa
sytabaresa / download-all-branches.sh
Last active November 2, 2018 15:32
descarga todas las ramas de un repo y actualiza las referencias a las ramas remotas (primero moverse a la carpeta del repo)
#!/bin/bash
# Moverse a la carpeta del repo primero
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
git branch --track "${branch##*/}" "$branch"
done
git fetch --all
git pull --all
function spreadsheetToPDF(key) {
var oauthConfig = UrlFetchApp.addOAuthService("spreadsheets");
var scope = "https://spreadsheets.google.com/feeds"
oauthConfig.setConsumerKey("anonymous");
oauthConfig.setConsumerSecret("anonymous");
oauthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope="+scope);
oauthConfig.setAuthorizationUrl("https://accounts.google.com/OAuthAuthorizeToken");
oauthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");