Skip to content

Instantly share code, notes, and snippets.

View taross-f's full-sized avatar

Taro Furuya taross-f

View GitHub Profile
@taross-f
taross-f / docker-compose.yml
Created September 28, 2019 15:12
sample docker-compose.yml with an image that runs npm install and build
version: "3"
services:
vuestic:
container_name: vuestic
build: ./vuestic
volumes:
- ./vuestic:/app
- /app/node_modules
- /app/dist
command: "http-server ./dist"
@taross-f
taross-f / set_emacs.sh
Last active May 16, 2019 05:55
emacs keybind
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']"
gsettings set org.gnome.desktop.interface gtk-key-theme Emacs
@taross-f
taross-f / disk_size.sql
Created February 5, 2019 03:14
useful sql
select name, MB from
(
select tbl, count(*) as MB
from stv_blocklist
where tbl in (
select id
from stv_tbl_perm)
group by tbl
) block_list
inner join stv_tbl_perm
@taross-f
taross-f / rm_all.sh
Created January 7, 2019 05:16
rm_all.sh
find ./ -name "*.pyc" -exec rm {} \;
@taross-f
taross-f / s3_bucket_size.sh
Created January 4, 2019 08:45
s3_bucket_size
aws s3 ls --profile default | awk '{print $3}' | xargs -L 1 -t aws s3 ls --recursive --human --sum --profile default | grep -e aws -e Total
@taross-f
taross-f / deploy.sh
Last active December 10, 2018 02:53
deploy lambda
#!/bin/bash
FUNCTION_NAME=
PROFILE=default
if [ $# -eq 1 ]; then
PROFILE=$1
fi
set -x
python -m compileall .
rm -rf /tmp/${FUNCTION_NAME}.zip
zip -r /tmp/${FUNCTION_NAME}.zip ./*
@taross-f
taross-f / date_span.py
Created October 15, 2018 04:29
date_span.py
def date_span(start_date, end_date):
for n in range((end_date - start_date).days + 1):
yield start_date + timedelta(n)
@taross-f
taross-f / gzip_nkf.sh
Created October 5, 2018 02:46
unzip, nkf, rename, zip
gunzip * && ls | xargs nkf -w --overwrite && ls | sed -e 'p;s/_s\.CSV/_s.UTF8\.CSV/' | xargs -n 2 mv && gzip *
@taross-f
taross-f / Dockerfile
Created July 31, 2018 13:36
rails tutorial dockerfile
FROM ruby:2.5.1
WORKDIR /app
COPY Gemfile* /app/
RUN apt-get update && \
apt-get install -y nodejs \
mysql-client \
postgresql-client \
@taross-f
taross-f / embed.md
Created June 24, 2018 07:00
embed youtube in markdown
[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg)](https://www.youtube.com/watch?v=YOUTUBE_VIDEO_ID_HERE)