Skip to content

Instantly share code, notes, and snippets.

View yamitzky's full-sized avatar

Mitsuki Ogasahara yamitzky

View GitHub Profile
@yamitzky
yamitzky / gulpfile.coffee
Created November 25, 2015 01:58
Gulp Sample
gulp = require 'gulp'
sourcemaps = require 'gulp-sourcemaps'
source = require 'vinyl-source-stream'
buffer = require 'vinyl-buffer'
browserify = require 'browserify'
watchify = require 'watchify'
uglify = require 'gulp-uglify'
babel = require 'babelify'
livereload = require 'gulp-livereload'
sass = require 'gulp-sass'
@yamitzky
yamitzky / index.ts
Created December 10, 2018 14:07
Firebase Cloud Functions File Upload
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
import { Storage } from '@google-cloud/storage'
import * as path from 'path'
import * as os from 'os'
import * as fs from 'fs'
import { spawn } from 'child-process-promise'
const gcs = new Storage({ keyFilename: path.resolve(__dirname, '..', 'service-account-credentials.json') })
admin.initializeApp()
import { useState, useCallback, useEffect } from 'react'
import { Auth, Hub } from 'aws-amplify'
export enum AuthState {
SignIn = 'signIn',
SignUp = 'signUp',
ConfirmSignIn = 'confirmSignIn',
ConfirmSignUp = 'confirmSignUp',
ForgotPassword = 'forgotPassword',
RequireNewPassword = 'requireNewPassword',
@yamitzky
yamitzky / post-aws-cost-to-slack.py
Last active October 14, 2019 13:40
Post AWS Cost to Slack / AWS の費用を Slack に投稿する
from collections import defaultdict
import datetime
import json
import urllib.parse
import os
import boto3
import requests
ce = boto3.client('ce')
@yamitzky
yamitzky / slack-dark-mode-emoji.py
Last active May 28, 2020 00:33
Slackの透過絵文字に白背景をつけます
import os
import requests
from io import BytesIO
from PIL import Image
import numpy as np
TOKEN = os.environ['SLACK_TOKEN']
res = requests.get('https://slack.com/api/emoji.list',
headers={'Authorization': f'Bearer {TOKEN}'})
@yamitzky
yamitzky / athena-query-analyzer.py
Created October 5, 2019 03:34
Athena で発行されたクエリ一覧を分析して、スキャン量の多いものを分析するやつ
from typing import List, Iterable, Iterator
import re
from itertools import groupby as _groupby
import datetime
import logging
import boto3
logging.basicConfig(level=logging.INFO)