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
import string | |
import secrets | |
def generate_password(size=10): | |
chars = f'{string.ascii_uppercase}{string.ascii_lowercase}{string.digits}{string.punctuation}' | |
return ''.join(secrets.choice(chars) for x in range(size)) | |
print(generate_password(10)) |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
## 仮想マシンの定義 | |
# ベースイメージ | |
config.vm.box = "centos/7" | |
# ホスト名 | |
config.vm.hostname = "develop" | |
# IPアドレス |
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 | |
$str_list = array( | |
'1000', | |
'10.10', | |
'10.0', | |
'アイウエオ.カキクケコ', | |
); | |
$pattern = '/([0-9].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 | |
#!/usr/bin/php | |
function remove_old($filename) | |
{ | |
foreach (glob($filename) as $file) { | |
unlink($file); | |
} | |
} |
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
# -*- coding: utf-8 -*- | |
from sklearn.externals import joblib | |
from sklearn.metrics import classification_report | |
import corpus | |
def predict(text): | |
dictionary = corpus.get_dictionary(create_flg=False) | |
vector = [corpus.get_vector(dictionary, text)] | |
clf = joblib.load("model/model") |
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
# coding:utf-8 | |
from random import choice | |
class ZundokoKiyoshi: | |
CORRECT_MESSAGE = 'ズンズンズンズンドコ' | |
RESULT_MESSAGE = 'キ・ヨ・シ!' |
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 | |
/** | |
* ElasticSearchとのやり取りをするクラス | |
*/ | |
class ElasticSearchService | |
{ | |
/** 接続先のElasticSearchのURL & ポート */ | |
const BASE_URL = 'localhost'; | |
const PORT = '9200'; |
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 | |
/** | |
* ElasticSearchとのやり取りをするクラス | |
*/ | |
class ElasticSearchService | |
{ | |
/** 接続先のElasticSearchのURL & ポート */ | |
const BASE_URL = 'localhost'; | |
const PORT = '9200'; |
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
#!/user/local/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Time::HiRes 'sleep'; | |
use Math::Round; | |
# | |
# メイン処理 |
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
if [ -f ~/.profile.local ]; then | |
. ~/.profile.local | |
fi |
NewerOlder