This file contains 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 React from 'react'; | |
import './App.css'; | |
import { useTodoController } from './App.controller'; | |
const App = () => { | |
const { state, actions } = useTodoController(); | |
return ( | |
<div className="container"> |
This file contains 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 { useMemo, useState } from "react" | |
export const useTodoController = () => { | |
const [todoList, setTodoList] = useState([]); | |
const [todoName, setTodoName] = useState(''); | |
const [doneTodo, undoneTodo] = useMemo(() => { | |
const done = todoList.filter(item => item.done).length; | |
const undone = todoList.length - done; |
This file contains 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 React, { useState } from 'react'; | |
import './App.css'; | |
const App = () => { | |
const [todoList, setTodoList] = useState([]); | |
const [todoName, setTodoName] = useState(''); | |
const addTodo = (e) => { | |
e.preventDefault(); |
This file contains 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 { useCallback, useState, useEffect } from 'react'; | |
function hasLocalStorageSupport() { | |
try { | |
if (typeof window === 'undefined') { | |
return false; | |
} | |
if (typeof localStorage === 'undefined' || typeof sessionStorage === 'undefined') { | |
return false; | |
} |
This file contains 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 hasLocalStorageSupport() { | |
try { | |
if (typeof window === 'undefined') { | |
return false; | |
} | |
if (typeof localStorage === 'undefined' || typeof sessionStorage === 'undefined') { | |
return false; | |
} | |
} catch(e) { | |
return false; |
This file contains 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
Show hidden characters
{ | |
"Normal function": { | |
"scope": "javascript,typescript,javascriptreact,typescriptreact", | |
"prefix": "fn", | |
"body": [ | |
"function $1($2) {", | |
" $3", | |
"}", | |
"" | |
], |
This file contains 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
# Run following commands to uninstall vscode completely | |
rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist | |
rm -fr ~/Library/Preferences/com.microsoft.VSCode.plist | |
rm -fr ~/Library/Caches/com.microsoft.VSCode | |
rm -fr ~/Library/Caches/com.microsoft.VSCode.ShipIt/ | |
rm -fr ~/Library/Application\ Support/Code/ | |
rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/ | |
rm -fr ~/.vscode/ |
This file contains 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
<script> | |
s3UploadUtility({ | |
fileInputElement: '#fileinputfield', | |
onFinished: function(paths) { | |
console.log(paths) | |
} | |
}) | |
</script> |
This file contains 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 styled from 'styled-components'; | |
/* | |
BaseElementProps { | |
// text alignment | |
textAlign?: 'left' | 'right' | 'center'; | |
// spacing | |
ml?: string; |
NewerOlder