Skip to content

Instantly share code, notes, and snippets.

View dahyun31x's full-sized avatar

김다현 (Dahyun Kim) dahyun31x

View GitHub Profile
@dahyun31x
dahyun31x / routing.js
Created September 25, 2021 12:19
[Next.js] 페이지의 일부분만 라우팅하기
import { useRouter } from 'next/router'
import Link from 'next/link'
export default function TabsPage() {
const router = useRouter()
const tab = router.query.tab || 0
return <div>
<ul>
<li><Link shallow href={{ pathname: '/tabs', query: { tab: 0 } }}>Tab 0</Link></li>
@dahyun31x
dahyun31x / test_input_and_output.py
Created November 10, 2021 02:27
pytest로 입출력을 테스트하는 방법
import csv
from io import StringIO
# 입력 스트림을 테스트, 출력 (스트링을 스트림으로 만들 수도 있음)
def test_load_csv():
raw = StringIO('a,b,c\n1,2,3\n4,5,6') # string을 stream으로 변경
actual = load_csv(raw)
expected = [
{'a': '1', 'b': '2', 'c': '3'},
{'a': '4', 'b': '5', 'c': '6'},
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs