Skip to content

Instantly share code, notes, and snippets.

View twingo-b's full-sized avatar
🏠
Working from home

Y.Fujiwara twingo-b

🏠
Working from home
  • Okayama,Japan
View GitHub Profile
@twingo-b
twingo-b / file0.txt
Created June 10, 2014 00:41
fluent-plugin-bigquery利用時に、tableを動的に設定する ref: http://qiita.com/twingo-b@github/items/864a3eb22083e7f0f239
<source>
type tail
format apache
time_format %d/%b/%Y:%H:%M:%S %z
path /var/log/httpd/access_log
tag td.apache_access_log
pos_file /var/lib/fluent/td.apache_access_log.pos
</source>
...
-- sum' [1, 2, 3, 4, 5] == 15
sum' :: [Int] -> Int
sum' [] = 0
-- sum' [x] = x
sum' (x:xs) = x + sum'(xs)
-- 実装書いてね!
-- product' [] == 1
-- product' [1, 2, 3, 4, 5] == 120
product' :: [Int] -> Int
@twingo-b
twingo-b / mysql_sample.sql
Last active July 29, 2016 09:16
20160730_dbstudychugoku_LT
-- 1990年に雇った人の現在給与一覧を取得
SELECT
departments.dept_name,
employees.last_name AS manager_last_name,
salaries.salary,
titles.title,
ninety_hire_man_employees.*
FROM (
SELECT
*
@twingo-b
twingo-b / redshift_sample.sql
Created July 29, 2016 07:33
20160730_dbstudychugoku_LT
-- 1990年に雇った人の現在給与一覧を取得
-- 部署ごとの給与TOP3を取得
WITH ninety_hire_man_employees AS (
SELECT
*
FROM
employees.employees
WHERE
hire_date BETWEEN '1990-01-01'
AND '1990-12-31'