Skip to content

Instantly share code, notes, and snippets.

View chroju's full-sized avatar

jutaro chroju

View GitHub Profile
package main
import (
"bufio"
"flag"
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
@chroju
chroju / intent_schema.json
Last active November 18, 2017 15:01
AlexaにAWSの請求金額を教えてもらう
{
"languageModel": {
"types": [
{
"name": "Service",
"values": [
{
"id": null,
"name": {
"value": "イーシーツー",
@chroju
chroju / .cvimrc
Last active November 16, 2019 13:16
cVimrc
set noautofocus
set autoupdategist
set cncpcompletion
set linkanimation
let mapleader = ','
let locale = 'jp'
let barposition = "bottom"
map d closeTab
'''
Follow these steps to configure the webhook in Slack:
1. Navigate to https://<your-team-domain>.slack.com/services/new
2. Search for and select "Incoming WebHooks".
3. Choose the default channel where messages will be sent and click "Add Incoming WebHooks Integration".
4. Copy the webhook URL from the setup instructions and use it in the next section.
@chroju
chroju / shell_script_template.sh
Created April 28, 2016 11:05
shell script template
#!/bin/bash
#
# description
# strict mode
set -euo pipefail
IFS=$'\n\t'
# variables
readonly COMMAND_NAME=$(basename ${0})
@chroju
chroju / aws_to_slack.js
Created April 16, 2016 13:30
aws to slack lambda function (node.js)
console.log('Loading function');
const https = require('https');
const url = require('url');
const slack_url = 'https://hooks.slack.com/xxxxx';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
exports.handler = function(event, context) {
@chroju
chroju / docker_cheatsheet.md
Last active June 8, 2016 05:58
Dockerチートシート

Docker Cheat Sheet

ps

# 起動中コンテナの表示
$ docker ps
# 全コンテナの表示
$ docker ps -a
# 最後に作成されたコンテナを表示(起動状態は問わない)

実践Vim

insertモード

  • C-oでワンショットノーマルモード
  • C-r0でレジスタ0からペースト
@chroju
chroju / file1.txt
Created January 23, 2016 15:03
aws-cliでLambdaのScheduled Eventを作成する ref: http://qiita.com/chroju/items/aa65fddadbc18a2e717a
$ aws iam create-role --role-name "lambdaEc2Execution" --asume-role-policy-document file://lambda_role.json
@chroju
chroju / crontab_cheatsheet.md
Last active January 28, 2016 03:55
crontabについて

about crontab

書式

* * * * * commnad
  • 左から分、時、日、月、曜日。
  • 曜日は日曜日0から始まる。
  • 範囲指定(1-5)が可能。