Skip to content

Instantly share code, notes, and snippets.

View jc3lee's full-sized avatar
🏠
Working from home

JC Lee jc3lee

🏠
Working from home
  • France
  • 06:21 (UTC +02:00)
View GitHub Profile
@jc3lee
jc3lee / .htaccess
Created July 19, 2024 15:41
.htaccess code for NextJS build exported to traditional server with Apache system
# 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]
@jc3lee
jc3lee / scm.js
Created July 17, 2020 13:45
Smallest Common Multiple FCC
function smallestCommons(arr) {
//extract numbers
var smallerNum, biggerNum
if(arr[0] < arr[1]) {
smallerNum = arr[0]
biggerNum = arr[1]
}else{
smallerNum = arr[1]
@jc3lee
jc3lee / wherefore.js
Created July 17, 2020 12:31
Wherefore art thou FCC
function whatIsInAName(collection, source) {
var arr = [];
// Only change code below this line
//fill array
arr = collection
//get source keys
var sourceKeys = Object.keys(source)
@jc3lee
jc3lee / test0.py
Created June 15, 2020 18:23
python exercise
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
@jc3lee
jc3lee / carousel-3D-v1.0.2.jsx
Created May 11, 2020 19:20
carousel 3D with Z axis rotation effect
@jc3lee
jc3lee / carousel-3D-v1.jsx
Created May 11, 2020 15:47
Carousel D v1
@jc3lee
jc3lee / carousel-attempt.jsx
Created May 10, 2020 15:41
Carousel attempt
@jc3lee
jc3lee / anim-card.jsx
Created May 5, 2020 07:48
react spring animation cards
// 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" },
@jc3lee
jc3lee / react-spring-image-viewer.jsx
Created May 1, 2020 17:35
React spring image viewer
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" },
]