Skip to content

Instantly share code, notes, and snippets.

@tatsunol
tatsunol / vue.md
Last active November 9, 2018 21:07
Vue 親・子コンポーネント関連

parentComponent.vue

<template>
<div>
	<h1>Parent</h1>
    <child-component :child-message="message" @update="update"></child-component>
</div>
</template>

<script>
@tatsunol
tatsunol / pythonlogging.py
Created June 20, 2018 14:19
Python Logging
import logging
import os
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logname = "program.log"
fh = logging.FileHandler(os.path.expanduser(logname))
fh.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
@tatsunol
tatsunol / main.md
Last active October 27, 2021 04:28
FlaskアプリケーションをUbuntuで動かすまで #https

Ubuntu

  • Apache関連インストール
$ sudo apt udpate 
$ sudo apt upgrade
$ sudo apt install apache2 software-properties-common

今回はシステムのPython3を利用

$ sudo apt install apache2 libapache2-mod-wsgi-py3
@tatsunol
tatsunol / settings.md
Created March 20, 2018 19:43
Linux Settings

~/.gitconfig

[user]
	name = tatsunode
    email = tatsunode@yahoo.co.jp
[core]
	editor = vim
    autocrlf = input
[color]
	ui = auto
@tatsunol
tatsunol / mulit.py
Created February 2, 2018 21:12
Python
import multiprocessing as multi
from multiprocessing import Pool
p = Pool(multi.cpu_count())
p.map(process, data_list)
p.close()
@tatsunol
tatsunol / gdal.md
Last active February 2, 2018 05:57
GIS-tools
@tatsunol
tatsunol / cors-setting
Created February 1, 2018 10:56
Django
# for debug
```
$ pip install django-cors-headers
```
project/settings.pyを編集
```
INSTALLED_APPS = [
...
'corsheaders'
@tatsunol
tatsunol / gitconfig
Last active February 1, 2018 18:07
Configs
[user]
name = tatsunode
email = tatsunode@yahoo.co.jp
[core]
editor = vim -c \"set fence=utf-8\"
[color]
diff = auto
status = auto
branch = auto
@tatsunol
tatsunol / aws-ec2-django.md
Last active November 6, 2017 11:58
AWS EC2 Apache + RDS Postgresqlで(geo)djangoで動かすまで

ubuntu server

インスタンスの作成. キーの取得.*.pem

RDSでDBの作成

postgresqlを利用(postgisのため) セキュリティグループの設定に注意.ポート5432空けておく. アクセスして"create extension postgis;"を実行.

[local] $ psql --host=hgoehoge.abcdefghi.ap-northeast-1.rds.amazonaws.com \
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
return true;
}
}
return super.dispatchKeyEvent(event);
}