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'; | |
function Counter() { | |
const [count, setCount] = useState(0); | |
return ( | |
<div> | |
<p>You clicked {count} times</p> | |
<button onClick={() => setCount(count + 1)}> | |
Click me |
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, { Component } from 'react'; | |
class Counter extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: 0 | |
}; | |
} |
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 BigClock() { | |
function makeClock(intervalInMs) { | |
return () => { | |
const clockIntervalId = window.setInterval(() => { | |
console.log('tick', intervalInMs); | |
}, intervalInMs); | |
return () => { | |
window.clearInterval(clockIntervalId); | |
console.log('disabled clock') |
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
class Clock extends Component { | |
componentDidMount() { | |
this.clockIntervalId = window.setInterval(() => { | |
console.log('tick'); | |
}, 1000) | |
} | |
componentWillUnmount() { | |
window.clearInterval(this.clockIntervalId); | |
} |
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 Clock() { | |
React.useEffect(() => { | |
const clockIntervalId = window.setInterval(() => { | |
console.log('tick'); | |
}, 1000); | |
return () => { | |
window.clearInterval(clockIntervalId); | |
}; | |
}, []); |
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
docker-machine start default | |
eval "$(docker-machine env default)" | |
docker-compose start |
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
trained with manners | |
very boring is console | |
very sher is boring | |
very smile like 'LOL' | |
very polite like 'hello' | |
such smile much like happy people are | |
wow | |
very happy is 'world' | |
such no manners anymore | |
wow |
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
{ | |
"name": "my-bower-project", | |
"version": "0.0.0", | |
"private": true, | |
"dependencies": { | |
"angularjs": "~1.3.15", | |
"jquery": "~2.1.3", | |
"lodash": "~3.6.0" | |
} | |
} |
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
main = lift shittyClock (every second) | |
isBroken t = | |
mod (floor (inSeconds t)) 2 == 0 | |
shittyClock t = | |
if isBroken t then plainText <| show "broken" else clock t | |
clock t = collage 400 400 [ filled lightGrey (ngon 12 110) |
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
'use strict'; | |
var fs = require('fs'), | |
instream = fs.createReadStream(process.argv[2]), | |
bufferSize = 16384, | |
buffer1 = new Int32Array(bufferSize), | |
buffer2 = new Int32Array(bufferSize), | |
seedReader = true, | |
_a = 0, | |
_token = -1, | |
_tokens = 1; |