Skip to content

Instantly share code, notes, and snippets.

@rmorse
rmorse / react-router-dom-v.6.02.prompt.blocker.js
Last active July 2, 2025 19:35
Adds back in `useBlocker` and `usePrompt` to `react-router-dom` version 6.0.2 (they removed after the 6.0.0 beta, temporarily)
/**
* These hooks re-implement the now removed useBlocker and usePrompt hooks in 'react-router-dom'.
* Thanks for the idea @piecyk https://github.com/remix-run/react-router/issues/8139#issuecomment-953816315
* Source: https://github.com/remix-run/react-router/commit/256cad70d3fd4500b1abcfea66f3ee622fb90874#diff-b60f1a2d4276b2a605c05e19816634111de2e8a4186fe9dd7de8e344b65ed4d3L344-L381
*/
import { useContext, useEffect, useCallback } from 'react';
import { UNSAFE_NavigationContext as NavigationContext } from 'react-router-dom';
/**
* Blocks all navigation attempts. This is useful for preventing the page from
* changing until some condition is met, like saving form data.
@choipd
choipd / openweathermap_api_translation_ko
Created February 13, 2016 06:07
OpenWeatherMap api의 다국어에 한국어 지원을 위한 협업용 파일
Parameter English Your language
200 thunderstorm with light rain 가벼운 비를 동반한 천둥구름
201 thunderstorm with rain 비를 동반한 천둥구름
202 thunderstorm with heavy rain 폭우를 동반한 천둥구름
210 light thunderstorm 약한 천둥구름
211 thunderstorm 천둥구름
212 heavy thunderstorm 강한 천둥구름
221 ragged thunderstorm 불규칙적 천둥구름
230 thunderstorm with light drizzle 약한 연무를 동반한 천둥구름
231 thunderstorm with drizzle 연무를 동반한 천둥구름
@albatrocity
albatrocity / git-version-control.markdown
Last active November 3, 2025 15:08
Some basic Git instructions for Github for Mac and the command line

Using Git version control for code projects

Creating a new code repo from a local working copy

  1. From the repositories view in the app, drag the project folder to the bottom of the left sidebar.
  2. Hit "Yes" when it asks if you want to create a local git repository
  3. Go to "Changes" view (⌘2)
  4. Select the files that you want to commit their current state to the repository. You can view the changes of the file by clicking on the double up arrow on the file name bar.