(stdin => {
// Define Function
const cube = n => n ** 3
// Declare Variable
const inputs = stdin.toString().trim().split('\n')
const x = parseInt(inputs[0], 10)
This file contains hidden or 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
if __name__ == '__main__': | |
# pythonの論理演算子を使った関数の実装 | |
_not = lambda p: not p | |
_and = lambda p, q: p and q | |
_or = lambda p, q: p or q | |
_xor = lambda p, q: not(p and q) and (p or q) | |
comparator = lambda fn: lambda list: fn(*list) | |
bit = [True, False] | |
twobit = [ |
This file contains hidden or 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
{ | |
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", |
This file contains hidden or 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
const list = [2, 3, 6] | |
const sum1 = (...args) => { | |
return args.reduce((a, b) => a + b) | |
} | |
const sum2 = (...args) => { | |
let acc = 0 | |
for (let v of args) { | |
acc += v |
This file contains hidden or 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 { | |
Card, | |
CardHeader, | |
CardContent, | |
CardActions | |
// List, | |
// ListItem, | |
// ListItemText, | |
// TextField |
This file contains hidden or 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
const getCurrentPosition = async () => { | |
const geolocation = options => new Promise((resolve, reject) => | |
navigator.geolocation.getCurrentPosition(resolve, reject, options) | |
) | |
const options = { enableHighAccuracy: true } | |
const position = await geolocation(options) | |
.then(json => json.coords) | |
.then(coords => ({ latitude: coords.latitude, longitude: coords.longitude })) | |
.catch(error => console.log(error)) |
This file contains hidden or 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>test</title> | |
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> | |
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script> | |
<div id="root"></div> | |
<script type="text/babel"> |
This file contains hidden or 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 { | |
TextField, | |
Button, | |
FormControl, | |
makeStyles, | |
createStyles | |
} from '@material-ui/core' | |
const App = props => { |
This file contains hidden or 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
body { | |
margin:0; | |
padding: 20px; | |
background: #FFF7FF; | |
} | |
.todo { | |
width:100%; | |
max-width:25rem; | |
margin:0 auto; | |
padding:20px; |
This file contains hidden or 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 sa from 'superagent' | |
class App extends React.Component { | |
constructor (props) { | |
super(props) | |
this.state = { items: null } | |
} | |
async loadedJSON () { | |
const getAPI = uri => |