Skip to content

Instantly share code, notes, and snippets.

Avatar
🍣
Enjoy sushi and sake

kaiba kaibadash

🍣
Enjoy sushi and sake
View GitHub Profile
View NoteReview.gs
// レビュー待ちのpull requestをお知らせ。
// トリガーから定期実行するのを想定している。
var CHANNEL = "your_review_channel";
var REPOSITORIES = [
"your_github/your_repository1",
"your_github/your_repository2"
];
function noteReviews() {
if (shouldSleep()) return;
@kaibadash
kaibadash / GitHubReview.gs
Last active May 20, 2019
GitHubReview.gs
View GitHubReview.gs
// GitHubからWebHookを受け、releaseタグを作成する。
// GitHub webhookで以下を受取るように設定すること
// - Pull request reviews
// - Pull request review comments
//
// dependencies:
// SlackApp https://script.google.com/macros/library/versions/d/1on93YOYfSmV92R5q59NpKmsyWIQD8qnoLYk-gkQBI92C58SPyA2x1-bq
var CHANNEL = "your_review_channel";
@kaibadash
kaibadash / connpass_shuffle.js
Last active Nov 21, 2018
connpass参加者一覧から重複を覗いてシャッフルするするBookmarklet
View connpass_shuffle.js
javascript: (function() {
names = {};
$(".display_name").each(function(index, u) {
let n = $(u).text().trim();
names[n] = n;
});
names = Object.keys(names).sort(function() { return Math.random() - .5; });
s = names.join("さん, ") + "さん";
window.prompt("", s);
})();
@kaibadash
kaibadash / camerize.rb
Last active Nov 6, 2018
Convert `export class hoge_moge` to `export class HogeMoge`
View camerize.rb
# How to use:
# find ./src -type f -name "*ts" | ruby camelize.rb
def capitalize(str)
str.split("_").map(&:capitalize).join
end
while (file = gets) do
output = ""
file.chomp!
p "start: #{file}"
@kaibadash
kaibadash / import_esa2esa.rb
Created Mar 11, 2018
Import exported esa markdowns to new esa team
View import_esa2esa.rb
require 'esa'
require 'pp'
require 'find'
class EsaExportedMarkdown
attr_reader :title, :category, :tags, :created_at, :updated_at, :published, :number, :body
INDEX_DATA_START = 1
INDEX_DATA_END = 7
INDEX_BODY_START = 10
def initialize(file_path)
View MinoDetecter
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MinoDetecter : MonoBehaviour {
void Start () {
}
void Update () {
@kaibadash
kaibadash / user_check.rb
Created Apr 15, 2017
1文字のアカウントが取れるかどうか調べる
View user_check.rb
require "net/http"
URL = "https://example.com/"
[*"a".."z", *"0".."9", "_"].each do |ch|
uri = URI.parse("#{URL}@#{ch}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
response = http.head(uri.request_uri)
puts "@#{ch} #{response.code}"
sleep 3 # 優しさ
end
View iot_hee_button.cpp
#include "mbed.h"
DigitalOut segA(dp1);
DigitalOut segB(dp2);
DigitalOut segC(dp4);
DigitalOut segD(dp5);
DigitalOut segE(dp6);
DigitalOut segF(dp9);
DigitalOut segG(dp10);
DigitalIn buttonPress(dp13);