Skip to content

Instantly share code, notes, and snippets.

View chroju's full-sized avatar

jutaro chroju

View GitHub Profile
@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 / 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})
'''
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 / .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
@chroju
chroju / intent_schema.json
Last active November 18, 2017 15:01
AlexaにAWSの請求金額を教えてもらう
{
"languageModel": {
"types": [
{
"name": "Service",
"values": [
{
"id": null,
"name": {
"value": "イーシーツー",
package main
import (
"bufio"
"flag"
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
@chroju
chroju / dynalist-candy.css
Last active May 12, 2022 02:56
Dynalist css
/* https://userstyles.org/styles/177309/dynalist-candy-1-2 */
/* @import url('https://fonts.googleapis.com/css?family=Montserrat:500&display=swap'); */
:root
{
--over: rgba(0,0,0,1);
--transparent: rgba(0,0,0,0);
--selected: rgba(0,0,0,.5);
--pink: #f20866;
--orange: #f59b47;
@chroju
chroju / surfingkeys.js
Last active December 31, 2024 11:35
surfingkeys
// option
settings.smoothScroll = false;
settings.omnibarPosition = 'bottom';
settings.hintAlign = 'left';
settings.focusAfterClosed = 'left';
settings.smartCase = false;
// chrome.storage.local.set({"noPdfViewer": 1})
// https://github.com/brookhong/Surfingkeys/issues/2159
// disable surfingkeys
@chroju
chroju / keybase.md
Created August 23, 2020 12:34
keybase.md

Keybase proof

I hereby claim:

  • I am chroju on github.
  • I am chroju (https://keybase.io/chroju) on keybase.
  • I have a public key ASDFTzlxwuIbbAr33Ye63uyIU54hdABK6jj6cMV_BLHiewo

To claim this, I am signing this object:

@chroju
chroju / elevator.js
Last active June 13, 2021 23:55
Elevator Saga
{
init: function(elevators, floors) {
var floorUpStatus = Array(floors.length);
floorUpStatus.fill(false);
var floorDownStatus = Array(floors.length);
floorDownStatus.fill(false);
elevators.forEach(function(elevator, i, array) {
elevator.on("idle", function() {
console.log("### on idle")