Skip to content

Instantly share code, notes, and snippets.

View o0h's full-sized avatar
😀
Working from home

Hideki Kinjyo o0h

😀
Working from home
View GitHub Profile
@o0h
o0h / get_chokkin_getsuyoubi.php
Last active December 14, 2015 21:09
この前の月曜日の日付を取得
<?php
function get_chokkin_getsuyoubi(){
$day = 86400; // 60*60*24;
$t_dow = date_create()->format('n');
return date('Y-m-d', time() - ($day * ($t_dow - 1)));
}
@o0h
o0h / get_days_until_next_nichiyoubi.php
Last active December 14, 2015 21:49
次の日曜日になるまでどのくらいかかるかを取得します
<?php
function get_days_until_next_nichiyoubi(){
return 6 -(date_create()->format('n'));
}
@o0h
o0h / docker_files_Dockerfile
Last active October 18, 2017 11:14
cakephpを雑に動かす時の私のdockerメモ
FROM php:7.1
RUN apt-get update && apt-get install -y --no-install-recommends \
libicu-dev \
wget \
vim \
git \
zsh \
lv \
zip \
@o0h
o0h / firebase analytics udfお試し.sql
Created March 22, 2018 03:40
event_dimを引数に取ってゴニョゴニョするUDFを書きたいんだけど型不一致で怒られて動かないよ、というお話
CREATE TEMP FUNCTION
hoge(event
STRUCT<
name STRING,
params ARRAY<
STRUCT<
key STRING,
value STRUCT<string_value STRING, int_value INT64, float_value FLOAT64, double_value FLOAT64>
>
>,
@o0h
o0h / new.json
Last active July 1, 2018 06:43
Firebase Scheme
{
"schema":{
"fields":[
{
"mode":"NULLABLE",
"name":"event_date",
"type":"STRING"
},
{
"mode":"NULLABLE",
@o0h
o0h / Docker_linter_Dockerfile
Last active February 22, 2021 00:46
(phpstan + phpcs + reviewdog) on Docker
FROM phpstan/phpstan:0.9
RUN apk --update --repository http://dl-cdn.alpinelinux.org/alpine/v3.7/community add \
git \
php7-intl
RUN cd /usr/bin && curl -fSL https://github.com/haya14busa/reviewdog/releases/download/0.9.11/reviewdog_linux_arm -o reviewdog && chmod +x ./reviewdog
COPY ./run.sh /tmp/run.sh
RUN chmod +x /tmp/run.sh
@o0h
o0h / config.php
Last active August 22, 2018 22:51
phanの設定について
<?php
return [
'file_list' => [
'config/functions.php',
],
'directory_list' => [
'src',
'vendor',
'.phan/stubs'
@o0h
o0h / index.js
Created October 13, 2018 13:17
Slack用の最低限のbotkit
// obtain from:
// Botkitで最小構成のSlack Bot https://qiita.com/nobukatsu/items/88917a2348628244bc42
// howdyai/botkit https://github.com/howdyai/botkit
const botkit = require('botkit')
const controller = botkit.slackbot({ debug: true })
controller.hears('hello', ['direct_message', 'direct_mention'], (bot, message) => {
bot.reply(message, 'Hello yourself!')
})
@o0h
o0h / travis-action.patch
Last active December 7, 2018 11:15
Travis CI API用のアクション定義
diff --git a/.github-aciton/travis-ci/.gitignore b/.github-aciton/travis-ci/.gitignore
new file mode 100644
index 0000000..ad46b30
--- /dev/null
+++ b/.github-aciton/travis-ci/.gitignore
@@ -0,0 +1,61 @@
+# Logs
+logs
+*.log
+npm-debug.log*
@o0h
o0h / CarDto.php
Created December 9, 2018 05:02
cakephp-dtoプラグインお試し
<?php
/**
* !!! Auto generated file. Do not directly modify this file. !!!
* You can either version control this or generate the file on the fly prior to usage/deployment.
*/
namespace App\Dto;
/**
* Car DTO