Skip to content

Instantly share code, notes, and snippets.

const yaml = require("js-yaml");
const fs = require("fs");
const path = require("path");
const setting = {};
const CONFIG_DIR = path.join(__dirname, "../", "config");
const ENVIRONMENTS_CONFIG_DIR = path.join(CONFIG_DIR, "settings");
const LOCAL_CONFIG_YAML = path.join(CONFIG_DIR, "settings.local.yml");
const CONFIG_YAML = path.join(CONFIG_DIR, "settings.yml");
@rike422
rike422 / file0.rb
Last active May 13, 2019 09:52
メール処理用のRuby製botフレームワークを作った(作っている) ref: https://qiita.com/rike422/items/46f02d073faf3b8e5176
require 'slack-ruby-client'
module Rounders
module Handlers
class Invoice < Rounders::Handlers::Handler
# メールをフィルタリングするAND条件、第二引数に渡したSymbolはメソッド名
on({
subject: 'Amazon Web Services Invoice Available',
from: 'aws-receivables-support@email.amazon.com'
@rike422
rike422 / file4.html
Last active April 19, 2019 09:26
シュッとHTMLをJSON化できるライブラリを作った ref: https://qiita.com/rike422/items/9b8a6f9bf16a5cbf5c99
<ul>
<li class="item">item1</li>
<li class="item">item2</li>
<li class="item">item3</li>
</ul>
@rike422
rike422 / peco_script.sh
Last active July 29, 2016 10:35
自分用pecoスクリプト
# http://k0kubun.hatenablog.com/entry/2014/07/06/033336
# http://qiita.com/wada811/items/78b14181a4de0fd5b497
function peco-select-history() {
typeset tac
if which tac > /dev/null; then
tac=tac
else
tac='tail -r'
fi
@rike422
rike422 / hubot-train-delay.coffee
Last active October 8, 2015 10:08
電車遅延ゲット
# Description:
# Search and show your train time in Japan
#
# Dependencies:
# "cheerio-httpcli", ""
#
# Configuration:
# None
#
# Commands:
@rike422
rike422 / .tmux.conf
Last active August 29, 2015 14:13
tmux.conf
# prefixキーをC-aに変更する
set -g prefix C-a
# C-bのキーバインドを解除する
unbind C-b
# キーストロークのディレイを減らす
set -sg escape-time 1
# ウィンドウのインデックスを1から始める
Array.prototype.sample = function(loop) {
var result = [], loop = loop || 1;
for(var i = 0; i < loop; i++) {
result.push(this[Math.floor(Math.random() * this.length)]);
}
return result;
}
@rike422
rike422 / file0.css
Created November 20, 2014 09:41
rubygems.orgを目に優しくするユーザcss
.body--index, .header--interior {
background-image: none;
}
body {
background-color: #846059;
}
@rike422
rike422 / coffee
Created October 29, 2014 11:02
hubot のなんだってスクリプト
nandatte = [
"http://suiseinanpa.com/wp-content/uploads/434536.jpg"
"https://shuyaout.files.wordpress.com/2014/10/1.gif"
"http://shimoinaba.cocolog-nifty.com/photos/uncategorized/2010/12/21/photo.jpg"
"http://livedoor.blogimg.jp/nandemoj22/imgs/3/9/3998d2a1.jpg"
]
module.exports = (robot) ->
robot.hear /(だったんだよ)/i, (msg) ->
@rike422
rike422 / shell
Created September 30, 2014 14:11
skypeから引っこ抜くやつ
echo ' SELECT chat.friendlyname, ms.timestamp, ms.author, ms.body_xml, ms.from_dispname FROM Messages as ms LEFT JOIN Chats as chat ON ms.chatname = chat.name;' | sqlite3 -csv main.db