๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a code for autocomplete the address in forms using ViaCEP endpoint. | |
<script> | |
function clean_forms() { | |
document.getElementById('street').value = (''); | |
document.getElementById('district').value = (''); | |
document.getElementById('city').value = (''); | |
document.getElementById('uf').value = (''); | |
} | |
function my_cb(content) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative 'enumerables' | |
=begin test variables | |
array_test = [1, 2, 3, 4, 5, 6] | |
obj_test = { one: 1, two: 2, three: 3 } | |
# Method call for tests each | |
puts '------------Original each--------------' | |
array_test.each { |e| p e**2 } | |
obj_test.each { |e| p e } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const projectBtn = document.querySelector('#project-btn'); | |
const projectName = document.querySelector('#new-project'); | |
window.addEventListener('load', () => { | |
if(JSON.parse(localStorage.getItem('projects')) === null) { | |
localStorage.setItem('projects', JSON.stringify(new Array)); | |
} | |
displayProjects(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const list = document.querySelectorAll('.list'); | |
for (let i = 0; i < list.length; i += 1) { | |
list[i].onclick = () => { | |
let j = 0; | |
while (j < list.length) { | |
list[j++].className = '.list'; | |
} | |
list[i].className = '.list active'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
int main() { | |
int i, c; | |
double pi, x, dn; | |
dn = 1.00; | |
pi = 4.00; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(){ | |
int x, lineFinalNumber, previousLineFinalNumber; | |
lineFinalNumber = 0; | |
previousLineFinalNumber = 1; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Box, Flex, Text } from "@chakra-ui/react"; | |
type StepProps = { | |
activeColor?: string; | |
defaultColor?: string; | |
title: string; | |
isFirst?: boolean; | |
index: number; | |
isActive?: boolean; | |
isLast?: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect, useRef } from 'react'; | |
/** | |
* Generated by | |
* @link - https://chat.openai.com | |
* | |
* React hook to access the window object. | |
* Make sure to check if window is defined before using it. | |
* | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRef, useState, useEffect } from 'react'; | |
export default function useScrollPercentage(): [ | |
React.RefObject<HTMLDivElement> | React.LegacyRef<HTMLDivElement>, | |
number | |
] { | |
const scrollRef = useRef<HTMLDivElement>(null); | |
const [scrollPercentage, setScrollPercentage] = useState(NaN); | |
const reportScroll = (e: any) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
--u: 2vmin; /* change size */ | |
--c1: #343a40; | |
--c2: #212529; | |
--s1: #0002; | |
--gp: 50%/calc(var(--u) * 10) calc(var(--u) * 10); | |
height: 100vh; | |
background: | |
repeating-conic-gradient(from 0deg at 50% 13.75%, var(--s1) 0 20.55%, #fff0 21.05% 79.13%, var(--s1) 79.63% 100% ) var(--gp), | |
repeating-conic-gradient(from 0deg at 50% 50%, #fff0 0 25%, var(--s1) 25% 29%, #fff0 30% 70%, var(--s1) 71% 75%, #fff0 75% 100%) var(--gp), |
OlderNewer