Keep changes in staged
git reset --soft HEAD~1
Remove changes completely
git reset --hard HEAD~1
| console.log(JSON.stringify(data, null, 2)); |
| function isAnagram(w1, w2) { | |
| if (w1.length !== w2.length) { | |
| return false | |
| } | |
| const a1 = Array.from(w1).sort() | |
| const a2 = Array.from(w2).sort() | |
| for (let i = 0; i < a1.length; i++) { | |
| if (a1[i] !== a2[i]) { |
| .accordion-content { | |
| overflow: hidden; | |
| max-height: 0; | |
| transition: max-height 0.5s cubic-bezier(0, 1, 0, 1); | |
| } | |
| .accordion-content.open { | |
| max-height: 1000px; | |
| transition: max-height 1s ease-in-out; | |
| } |
| import { useState, useEffect } from 'react'; | |
| function useDebounce(value, delay) { | |
| const [debouncedValue, setDebouncedValue] = useState(value); | |
| useEffect(() => { | |
| const handler = setTimeout(() => { | |
| setDebouncedValue(value); | |
| }, delay); | |
| return () => { |
| git push -d <remote_name> <branch_name> |
| git fetch origin pull/123/head:pr/123 && git checkout pr/123 |
| Varje gång man kommer hem till gamla söder | |
| och ser ut från Mosebacke över stan | |
| då går pumpen varm ja så det nästan glöder | |
| det var här som man höll till när man var barn | |
| Minns hur vackert ljusen spegla sig om natten | |
| passa på att stanna till en liten stund | |
| ser hur silvertärnor smeker saltsjöns vatten | |
| medan färjan lägger till vid Gröna lund |
| docker run -d -p 8082:80 --mount type=bind,source="$(pwd)/htdocs",target=/var/www/html php:apache | |
| 1. If the Docker image php:apache is not present in your machine's local Docker registry, it will be downloaded from Docker hub. | |
| 2. It creates a new container based on the image php:apache. | |
| 3. It maps port 80 from the container to port 8082 on your host machine. | |
| 4. It mounts the directory htdocs/ from your host machine to /var/www/html in the container. | |
| https://nelkinda.com/blog/apache-php-in-docker/ |
| import React, { useContext, useState } from 'react'; | |
| const initialState = 'Jimbo'; | |
| const JimboContext = React.createContext(initialState, () => {}); | |
| export const JimboProvider = ({ children }) => { | |
| const [state, setState] = useState(initialState); | |
| return ( | |
| <JimboContext.Provider value={[state, setState]}> | |
| {children} |