Skip to content

Instantly share code, notes, and snippets.

View taishikato's full-sized avatar
🏠
Working from home

Taishi taishikato

🏠
Working from home
View GitHub Profile
/* eslint-disable no-unused-vars */
// uncaughtException発生時はプロセスを落とす
process.on('uncaughtException', (err) => {
logger.fatal(`UncaughtException Occured: ${err}`);
process.exit(1);
});
@taishikato
taishikato / file0.txt
Last active January 30, 2018 23:49
vuefireでFirestoreとbindするときにハマったこと ref: https://qiita.com/takato0903/items/6092e773de499113c9da
TypeError: _this.$bindAsObject is not a function
@taishikato
taishikato / App.vue
Created January 8, 2018 04:43
Vue.jsアプリでCloudinaryに画像をアップロードする ref: https://qiita.com/takato0903/items/a549afae56cbfa9d97d9
<template>
<div id="app">
<input type="file" v-on:change="upload($event.target.files)" accept="image/*" />
</div>
</template>
<script>
import axios from 'axios'
export default {
@taishikato
taishikato / Home.vue
Last active January 5, 2018 14:18
FirestoreとVue.jsで連絡先管理アプリを作ってみる ref: https://qiita.com/takato0903/items/ecd18322a50e1728ad4b
<template>
<section class="container">
<div class="columns">
<div class="column is-8">
<h1>All Contacts</h1>
<router-link class="button is-primary" to="/add">Add New Contact</router-link>
<div class="loader-section" v-if="loading">
<div class="user-list">
@taishikato
taishikato / delete_notemptydir.php
Created April 13, 2016 01:31
Delete the directory which has files
class Test
{
public function rmrf($dir)
{
if (is_dir($dir) and !is_link($dir)) {
array_map(array($this, 'rmrf'), glob($dir.'/*'));
array_map('unlink', glob($dir.'/*'));
rmdir($dir);
}
}
YESTERDAY=`date --date '1 day ago' +%Y%m%d`
echo ${YESTERDAY}
<?php
//処理速度計測開始▼
$time_start = microtime(true);
#ここに計測したい処理を書く
//処理速度計測終了▲
$timelimit = number_format(microtime(true) - $time_start, 7);
echo '処理時間: ' .$timelimit . '秒'."\n";
newfile = Array.new
CSV.foreach("test.tsv", "r") do |row|
newfile.push(row.join("\t"))
end
File.open("test.tsv", "w+") do |file|
newfile.each do |elem|
file.puts elem.tosjis
end
end
@taishikato
taishikato / mojbake.rb
Created March 19, 2014 06:21
Excelで開いたときの文字化け防止
if value.instance_of?(String)
value = value.tosjis
end