Skip to content

Instantly share code, notes, and snippets.

@sugiii8
sugiii8 / shuffle_slack_noti_sheetless.js
Created Sep 13, 2019
リストをシャッフルしてSlack通知する(シートなしgasのみ版)
View shuffle_slack_noti_sheetless.js
function setTrigger() {
// 使用済トリガー削除
delTrigger()
// 9:45
var triggerDate = new Date();
const week =triggerDate.getDay();
if (week == 0 || week == 6) {
// holiday no working
return;
@sugiii8
sugiii8 / shuffle_slack_noti.js
Last active Sep 10, 2019
シートをシャッフルしてSlack通知するgas
View shuffle_slack_noti.js
function getLastRowWithValue() {
const sheet = SpreadsheetApp.getActiveSheet();
const names = sheet.getRange('A:A').getValues().filter(String);
shuffle(names);
const message = names.join('\n')
slack(message)
}
function shuffle(array) {
@sugiii8
sugiii8 / karaoke_machine.rb
Last active Sep 7, 2019
answer of KaraokeMachine
View karaoke_machine.rb
# coding: utf-8
class KaraokeMachine
SCALE = %w(C C# D D# E F F# G G# A A# B)
def initialize(melody)
@scales = melody.gsub(/([A-Z]#*|\|| )/, '\1s').split("s")
end
def transpose(amount)