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
<!-- index.html --> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>React Tutorial</title> | |
<script src="https://unpkg.com/[email protected]/dist/react.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/react-dom.js"></script> | |
<script src="https://unpkg.com/[email protected]/browser.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></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
# 10進数、2進数、8進数で回文の最小値 | |
# ただし、10進数で10以上の数とする | |
require 'benchmark' | |
# 回文チェック関数 | |
def check(num, target) | |
str = num.to_s(target) # targetに指定した進数の文字列に変換 | |
if str == str.reverse # 逆順と等しいか | |
return true |
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
<?php | |
// 1-100までのカードがある | |
// n番目のカードからn-1枚おきにカードを裏返す | |
// 状態が変わらなくなるまで繰り返した時、裏になっているカードを求める | |
// 表をtrue、裏をfalseとして配列を生成 | |
$card_list = array_fill(1, 100, false); | |
// 最大値は最後の100枚目 | |
for ($i = 2; $i <= 100; $i++) { |
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
version: '2' | |
services: | |
db: | |
image: mysql:5.7 | |
# ./.data/db(ホストOS)にデータが保持される | |
volumes: | |
- "./.data/db:/var/lib/mysql" | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress |
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
request = service.files().get_media(fileId=foo) | |
dirname = bar | |
name = baz | |
os.makedirs(dirname, 0o777, True) | |
fh = io.FileIO(os.path.join(dirname, name), mode='wb') | |
downloader = MediaIoBaseDownload(fh, request) | |
done = False | |
while done is False: | |
status, done = downloader.next_chunk() | |
print("Download %d%%." % int(status.progress() * 100)) |
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
# EditorConfig helps developers define and maintain consistent | |
# coding styles between different editors and IDEs | |
# editorconfig.org | |
root = true | |
[*] | |
# Change these settings to your own preference | |
indent_style = space | |
indent_size = 2 |
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
{ | |
"extends": "eslint-config-rallycoding", | |
"rules": { | |
"no-underscore-dangle": 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
<?php | |
$data = range(1, 10); | |
print_r($data); | |
x2val($data); | |
print_r($data); | |
function x2val(&$data) { | |
foreach ($data as &$val) { | |
$val = $val * 2; |
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
box: node | |
build: | |
steps: | |
- script: | |
name: npm build | |
code: | | |
npm install -g gatsby | |
yarn install | |
gatsby build | |
deploy: |
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
swagger-editor: | |
image: swaggerapi/swagger-editor | |
container_name: "swagger-editor-container" | |
ports: | |
- "8081:8080" | |
swagger-ui: | |
image: swaggerapi/swagger-ui | |
container_name: "swagger-ui-container" | |
ports: | |
- "8082:8080" |
OlderNewer