Skip to content

Instantly share code, notes, and snippets.

View nabeen's full-sized avatar
🤔
Who am I ?

Kenichiro Watanabe nabeen

🤔
Who am I ?
View GitHub Profile
@nabeen
nabeen / index.html
Created October 11, 2016 07:58
react_tutorial
<!-- 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>
@nabeen
nabeen / puzzle_q1.ruby
Created November 18, 2016 10:55
数学パズルQ1
# 10進数、2進数、8進数で回文の最小値
# ただし、10進数で10以上の数とする
require 'benchmark'
# 回文チェック関数
def check(num, target)
str = num.to_s(target) # targetに指定した進数の文字列に変換
if str == str.reverse # 逆順と等しいか
return true
@nabeen
nabeen / puzzle_q3.php
Last active January 25, 2017 01:03
数学パズルQ3
<?php
// 1-100までのカードがある
// n番目のカードからn-1枚おきにカードを裏返す
// 状態が変わらなくなるまで繰り返した時、裏になっているカードを求める
// 表をtrue、裏をfalseとして配列を生成
$card_list = array_fill(1, 100, false);
// 最大値は最後の100枚目
for ($i = 2; $i <= 100; $i++) {
version: '2'
services:
db:
image: mysql:5.7
# ./.data/db(ホストOS)にデータが保持される
volumes:
- "./.data/db:/var/lib/mysql"
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
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))
@nabeen
nabeen / .editorconfig
Last active February 5, 2018 02:06
.editorconfig file
# 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
@nabeen
nabeen / .eslintrc
Created February 7, 2018 17:30
.eslintrc sample for react native
{
"extends": "eslint-config-rallycoding",
"rules": {
"no-underscore-dangle": 0
}
}
@nabeen
nabeen / reference_call.php
Created April 4, 2018 09:01
use reference call in PHP
<?php
$data = range(1, 10);
print_r($data);
x2val($data);
print_r($data);
function x2val(&$data) {
foreach ($data as &$val) {
$val = $val * 2;
@nabeen
nabeen / wercker.yml
Created April 6, 2018 14:23
gatsby build and deploy to firebase
box: node
build:
steps:
- script:
name: npm build
code: |
npm install -g gatsby
yarn install
gatsby build
deploy:
@nabeen
nabeen / docker-compose.yml
Last active May 15, 2024 21:50
swagger-editor / swagger-ui docker-compose
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"