Skip to content

Instantly share code, notes, and snippets.

Avatar

Masayoshi Wada masawada

View GitHub Profile
View dotfiles-redirector-stack.ts
import { Stack, StackProps, RemovalPolicy } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
import * as origins from 'aws-cdk-lib/aws-cloudfront-origins';
import * as acm from 'aws-cdk-lib/aws-certificatemanager';
export interface DotfilesRedirectorStackProps extends StackProps {
readonly certificateArn: string;
}
View nas-backup-stack.ts
// aws-cdk-lib 2.35.0
import { Stack, StackProps, RemovalPolicy, Duration } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as iam from 'aws-cdk-lib/aws-iam';
export class NasBackupStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
View hatenablog-link-icon-beside-headings.html
@masawada
masawada / git-af.sh
Last active Oct 9, 2020
save as /usr/local/bin/git-af
View git-af.sh
#!/bin/bash
BRANCH=$1
FILE_PATH=$2
[ -v $BRANCH ] && BRANCH=$(git branch -l | grep -Ev '^\*' | awk '{ print $1 }' | peco)
[ -v $BRANCH ] && echo 'branch not found' && exit;
[ -v $FILE_PATH ] && FILE_PATH=$(git ls-files | peco)
[ -v $FILE_PATH ] && echo 'file_path not found' && exit;
View git-new-repo
#!/bin/bash
# LICENSE: MIT
SERVICE_NAME="github.com"
USER_NAME=$USER
usage_exit() {
echo "Usage: git new-repo [-u user] [-s service] repo_name" 1>&2
exit 1
View todo.sh
#!/bin/bash
if ! type peco > /dev/null 2>&1; then
echo 'peco not found'
exit 1;
fi
COMMAND=$1
[ -v $COMMAND ] && COMMAND="edit"
[ -v $TODO_DIR ] && TODO_DIR="$HOME/.todo"
@masawada
masawada / rbenv_install_for_archlinux.sh
Created Jan 30, 2019 — forked from masayoshi634/rbenv_install_for_archlinux.sh
ArchLinuxでruby-buildする時のメモ
View rbenv_install_for_archlinux.sh
#!/bin/sh
#####################
# for archlinux 2017/11/05
# depend
pacman -S libffi libyaml openssl zlib openssl-1.0
yay -S gcc6 --noconfirm
View sendMessageToSlack.js
const url = require('url');
const https = require('https');
const slack_url = url.parse(process.env.SLACK_URL);
const channel = process.env.CHANNEL;
const username = process.env.USERNAME;
const icon_emoji = process.env.ICON_EMOJI;
const messages = {
SINGLE : process.env.SINGLE_CLICK_MESSAGE,
DOUBLE : process.env.DOUBLE_CLICK_MESSAGE,
View build_percona_query_payback.sh
yum -y localinstall http://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
# enable the mysql version which you want to test
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql56-community
yum -y groupinstall "Development Tools"
yum -y install tbb tbb-devel cmake boost boost-devel gcc-c++ openssl-devel wget mysql-devel
wget https://github.com/Percona-Lab/query-playback/archive/master.zip
unzip master.zip
cd query-playback-master/
mkdir build_dir
View changelogs.yml
react: https://github.com/facebook/react/blob/master/CHANGELOG.md
react-dom: https://github.com/facebook/react/blob/master/CHANGELOG.md
karma: https://github.com/karma-runner/karma/blob/master/CHANGELOG.md
babel: https://github.com/babel/babel/blob/7.0/CHANGELOG.md
babel-preset-react: https://github.com/babel/babel/blob/7.0/CHANGELOG.md
babel-preset-stage-2: https://github.com/babel/babel/blob/7.0/CHANGELOG.md
browserify: https://github.com/substack/node-browserify/blob/master/changelog.markdown
eslint: https://github.com/eslint/eslint/blob/master/CHANGELOG.md
moment: https://github.com/moment/moment/blob/develop/CHANGELOG.md
gulp.spritesmith: https://github.com/twolfson/gulp.spritesmith/blob/master/CHANGELOG.md