title | date |
---|---|
How to add Tailwind CSS for Docusaurus |
2021-06-22 |
- Install Docusaurus
npx @docusaurus/init@latest init site-name class
function App() { | |
const [count, setCount] = useState(0); | |
const [message, setMessage] = useState(""); | |
function increment() { | |
setCount(count + 1); | |
setMessage(`count is ${count}`); | |
} | |
function decrement() { |
#https://unix.stackexchange.com/a/377601/334761 | |
# Get the device id with "xinput" | |
# Look for "Wacom Intuos PT S Pen stylus" | |
# Get the ID value. e.g.) id=14 | |
# pass the ID (14 for mine) as "device" in | |
# xinput MAN page: https://linux.die.net/man/1/xinput | |
xinput set-prop 14 "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1 | |
# default |
/* /index.html 200 |
let bt = document.createElement('button') | |
bt.appendChild(document.createTextNode('Close')) | |
bt.addEventListener('click', function(e) { | |
this.parentElement.style.display = 'none'; | |
}); | |
// Subscriptions panel | |
let subEl = document.querySelector("#sections > ytd-guide-section-renderer:nth-child(2)") | |
subEl.prepend(bt) |
class Greeting extends Component { | |
hello = id => console.log(`hello world! - ${id}`); | |
componentDidMount() { | |
const id = shortid.generate(); | |
setInterval(e => this.hello(id), 1000); | |
} | |
componentWillUnmount() { | |
console.log("Greeting unmounted..."); |
function useAsyncState(initialValue) { | |
const [value, setValue] = useState(initialValue); | |
const setter = x => | |
new Promise(resolve => { | |
setValue(x); | |
resolve(x); | |
}); | |
return [value, setter]; | |
} |
dance2die@CC c:\misc\sources | |
> yarn global bin | |
C:\Users\dance2die\AppData\Roaming\npm\bin |
{ | |
"arrowParens": "always", | |
"bracketSpacing": true, | |
"embeddedLanguageFormatting": "auto", | |
"htmlWhitespaceSensitivity": "css", | |
"insertPragma": false, | |
"jsxBracketSameLine": false, | |
"jsxSingleQuote": false, | |
"printWidth": 100, | |
"proseWrap": "preserve", |
function repeatDemo() { | |
const texts = Array(5) | |
.fill() | |
.map(_ => "I love your smile"); | |
texts.map(text => WriteLine(text)); | |
} |