Skip to content

Instantly share code, notes, and snippets.

View naoki-sawada's full-sized avatar
🍮

Naoki Sawada naoki-sawada

🍮
View GitHub Profile
@naoki-sawada
naoki-sawada / bash_profile
Last active September 27, 2017 01:17
bash_profile
#######################
# Path settings
#######################
export PATH=$HOME/anaconda/bin:$PATH
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
#######################
# Bash settings
#######################
@naoki-sawada
naoki-sawada / rename.py
Last active August 8, 2017 02:51
replace the file name.
import os
from shutil import copyfile
from pathlib import Path
SOURCE_PATH = '.'
DEST_PATH = './re'
d_path = Path(DEST_PATH)
if not d_path.is_dir():
os.makedirs(DEST_PATH)
@naoki-sawada
naoki-sawada / index.html
Last active February 21, 2021 08:58
scaffold of html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<script src="scaffold.js"></script>
<title>Scaffold</title>
</head>
<body>
<div></div>
article,aside,details,figcaption,figure,footer,header,hgroup,hr,menu,nav,section{display:block}a,hr{padding:0}abbr,address,article,aside,audio,b,blockquote,body,canvas,caption,cite,code,dd,del,details,dfn,div,dl,dt,em,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,p,pre,q,samp,section,small,span,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,ul,var,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:0 0}ins,mark{background-color:#ff9;color:#000}body{line-height:1}nav ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}a{margin:0;font-size:100%;vertical-align:baseline;background:0 0}ins{text-decoration:none}mark{font-style:italic;font-weight:700}del{text-decoration:line-through}abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help}table{border-collapse:collapse;border-spacing:0}hr{height:1px;bo
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import serial
import math
def makeSendData(val):
print val
if val >= 100:
h = int(math.floor(val/100))
import MeCab
text = 'けものフレンズのサーバルちゃん可愛い'
tagger_options = [
'-d /usr/local/lib/mecab/dic/mecab-ipadic-neologd',
'--eos-format=''',
# '--node-format=%f[8]',
]
# -*- coding: utf-8 -*-
import re
import serial
port = '/dev/cu.usbserial-DN0129J0'
baud = 115200
ser = serial.Serial(port, baud, stopbits=serial.STOPBITS_ONE, parity=serial.PARITY_NONE)
while True:
[alias]
graph = log --graph --date-order -C -M --pretty=format:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=short
ignore = !"f() { local s=$1; shift; \
while [ $# -gt 0 ]; do s=\"$s,$1\"; shift; done;\
curl \"https://www.gitignore.io/api/$s\"; }; f"
import cv2
import numpy as np
from keras.applications.mobilenet import MobileNet
from keras.preprocessing import image
from keras.applications.mobilenet import preprocess_input, decode_predictions
IMG_SIZE = 224
IMG_NAME = 'photo.jpg'
model = MobileNet(weights='imagenet')
#!/bin/bash
curl "http://webapi.aitalk.jp/webapi/v2/ttsget.php" \
-o "$1.wav" \
-d "text=$1" \
-d "speaker_name=nozomi" \
-d "ext=wav" \
-d "username={YOUR_API_USER_NAME}" \
-d "password={YOUR_API_PASSWORD}" \