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
| # For NextJS build exported to traditional server with Apache system | |
| # To make pages links work without needing to add ".html" to the href | |
| RewriteBase / | |
| # Add .html to URLs without it, except for the root URL | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_URI} !^/$ | |
| RewriteRule ^(.*)$ $1.html [L] |
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
| function smallestCommons(arr) { | |
| //extract numbers | |
| var smallerNum, biggerNum | |
| if(arr[0] < arr[1]) { | |
| smallerNum = arr[0] | |
| biggerNum = arr[1] | |
| }else{ | |
| smallerNum = arr[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
| function whatIsInAName(collection, source) { | |
| var arr = []; | |
| // Only change code below this line | |
| //fill array | |
| arr = collection | |
| //get source keys | |
| var sourceKeys = Object.keys(source) |
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
| def my_function(list): | |
| #The first part is made up of all the list items except the last one. They are joined with ", " | |
| separator = ', ' | |
| firstPart = separator.join(list[0: (len(list) - 1)]) | |
| #The second part is made up of "and " and the last item of the list | |
| secondPart = " and " + list[len(list) - 1] | |
| #add the two parts and you get the result string | |
| resultString = firstPart + secondPart | |
| return resultString |
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
| //Adapted from: | |
| //https://www.youtube.com/watch?v=vbsU3za5vhE | |
| //https://www.youtube.com/watch?v=n2xj046c8mM | |
| import { useSpring, useSprings, animated, config } from "react-spring" | |
| import { useEffect, useRef } from "react" | |
| import { useDrag, useGesture } from "react-use-gesture" | |
| //responsive carousel, try adding and removing images | |
| const itemsArr = [ |
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
| //Adapted from: | |
| //https://www.youtube.com/watch?v=vbsU3za5vhE | |
| //https://www.youtube.com/watch?v=n2xj046c8mM | |
| import { useSpring, useSprings, animated, config } from "react-spring" | |
| import { useEffect, useRef } from "react" | |
| import { useDrag, useGesture } from "react-use-gesture" | |
| //responsive carousel, try adding and removing images | |
| const itemsArr = [ |
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 { useSprings, config, animated, useSpring } from "react-spring" | |
| import { useEffect, useState, useRef } from "react" | |
| import useMeasure from 'react-use-measure' | |
| import { useDrag, useGesture } from 'react-use-gesture' | |
| import { ResizeObserver } from '@juggle/resize-observer' | |
| const items = [ | |
| { background: "rgba(0, 255, 255, 0.5)" }, | |
| { background: "rgba(142, 110, 192, 0.5)" }, | |
| { background: "rgba(228, 41, 166, 0.5)" }, |
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 code is not responsive design. Use it however u like. It'd be awesome if u make it responsive and show me xD | |
| import { useSprings, config, animated } from "react-spring" | |
| const cards = [ | |
| { cover: "/card1.png", title: "One Piece", desc: "Luffy, a boy with a rubber body go in search of the treasure One Piece", color: "#29b8ff", myGif: "/luffy1.gif" }, | |
| { cover: "/card0.png", title: "Naruto", desc: "Naruto is a ninja who seeks recognition from his peers and dreams of becoming the Hokage.", color: "#f9473e", myGif: "/naruto1.gif" }, | |
| { cover: "/card3.png", title: "Gintama", desc: "In alien conquered Edo, Sakata Gintoki and his crew work as freelancers to pay monthly rent.", color: "#aaa9ad", myGif: "/ginta1.gif" }, |
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 { useEffect, useState } from 'react' | |
| import { animated, config, useSprings, useTransition } from 'react-spring' | |
| const imgArr = [ | |
| { key: 0, src: "https://images.wallpaperscraft.com/image/city_evening_snowfall_136478_1920x1080.jpg" }, | |
| { key: 1, src: "https://images.wallpaperscraft.com/image/night_city_street_car_113387_1920x1080.jpg" }, | |
| { key: 2, src: "https://images.wallpaperscraft.com/image/trolley_stop_city_evening_lighting_119292_1920x1080.jpg" }, | |
| { key: 3, src: "https://images.wallpaperscraft.com/image/night_city_street_city_lights_134353_1280x720.jpg" }, | |
| { key: 4, src: "https://images.wallpaperscraft.com/image/street_neon_night_city_139596_1280x720.jpg" }, | |
| ] |
NewerOlder