Skip to content

Instantly share code, notes, and snippets.

@sugiii8
sugiii8 / shuffle_slack_noti_sheetless.js
Created September 13, 2019 05:29
リストをシャッフルしてSlack通知する(シートなしgasのみ版)
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 September 10, 2019 02:30
シートをシャッフルしてSlack通知するgas
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 September 7, 2019 22:20
answer of KaraokeMachine
# 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)