Skip to content

Instantly share code, notes, and snippets.

View totuworld's full-sized avatar

totuworld totuworld

View GitHub Profile
@totuworld
totuworld / create_form_from_sheet.js
Created February 17, 2025 01:57
create_form_from_sheet.js
function onOpen() {
// ์Šคํ”„๋ ˆ๋“œ์‹œํŠธ ์—ด๋ฆด ๋•Œ ์‚ฌ์šฉ์ž ์ •์˜ ๋ฉ”๋‰ด ์ถ”๊ฐ€
const ui = SpreadsheetApp.getUi();
ui.createMenu('๋‚˜์˜ ๋ฉ”๋‰ด') // "๋‚˜์˜ ๋ฉ”๋‰ด"๋ผ๋Š” ์‚ฌ์šฉ์ž ๋ฉ”๋‰ด ์ƒ์„ฑ
.addItem('์„ค๋ฌธ์ง€ ๋งŒ๋“ค๊ธฐ', 'createFormFromSheet') // "์„ค๋ฌธ์ง€ ๋งŒ๋“ค๊ธฐ" ๋ฒ„ํŠผ ์ถ”๊ฐ€
.addToUi();
}
function createFormFromSheet() {
const ui = SpreadsheetApp.getUi();
@totuworld
totuworld / gist:2428c996fd0b79bb70ca0d8e7bae59b9
Last active September 21, 2023 14:41
sendEmailWithFile.js
function sendEmail() {
const ss = SpreadsheetApp.getActiveSpreadsheet()
const sheet1 = ss.getSheetByName('list2'); // ์ด๋ฉ”์ผ ๋ณด๋‚ผ ์‚ฌ๋žŒ๋“ค ๋ชฉ๋ก์ด ๋“ค์–ด๊ฐ„ ์‹œํŠธ๋ช…!
const sheet2 = ss.getSheetByName('template'); // ์ด๋ฉ”์ผ ๋‚ด์šฉ์ด ๋“ค์–ด๊ฐ„ ์‹œํŠธ๋ช…!
const subject = sheet2.getRange(2,1).getValue(); // ์ด๋ฉ”์ผ ์ œ๋ชฉ ์ถ”์ถœ
const n = sheet1.getLastRow(); // ์ด๋ฉ”์ผ ๋ณด๋‚ผ ๋ช…๋‹จ์ด ์ „์ฒด ๋ช‡ ๋ช…์ธ์ง€ ํ™•์ธ
const folder = DriveApp.getFolderById('ํด๋”ID'); // ํด๋” id๋ฅผ ํ™•์ธํ•ด์„œ ์ถ”๊ฐ€
const files = folder.getFiles();
const fileMap = new Map(); // TOTO: Object๋Œ€์‹  Map์„ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ๋ฒ•์ด ์กฐ๊ธˆ ๋‹ค๋ฅธ ๋ฌธ๋ฒ•์ด๋ผ๊ณ ๋งŒ ์ดํ•ดํ•˜์…”๋„ ์ถฉ๋ถ„ํ•ฉ๋‹ˆ๋‹ค.
while (files.hasNext()) {
@totuworld
totuworld / emailTemplate.html
Last active April 28, 2023 07:10
appsScript
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<img src='cid:megaphone' />
<h2>์•ˆ๋…•ํ•˜์„ธ์š” <?= name ?>๋‹˜</h2>
<p>
์ด๋ฒˆ๋‹ฌ ์ฒญ๊ตฌ๊ธˆ์•ก ์•ˆ๋‚ด๋“œ๋ฆฝ๋‹ˆ๋‹ค.<br />
function sendEmail() {
const ss = SpreadsheetApp.getActiveSpreadsheet()
const sheet1 = ss.getSheetByName('list'); // ์ด๋ฉ”์ผ ๋ณด๋‚ผ ์‚ฌ๋žŒ๋“ค ๋ชฉ๋ก์ด ๋“ค์–ด๊ฐ„ ์‹œํŠธ๋ช…!
const sheet2 = ss.getSheetByName('template'); // ์ด๋ฉ”์ผ ๋‚ด์šฉ์ด ๋“ค์–ด๊ฐ„ ์‹œํŠธ๋ช…!
const subject = sheet2.getRange(2,1).getValue(); // ์ด๋ฉ”์ผ ์ œ๋ชฉ ์ถ”์ถœ
const n = sheet1.getLastRow(); // ์ด๋ฉ”์ผ ๋ณด๋‚ผ ๋ช…๋‹จ์ด ์ „์ฒด ๋ช‡ ๋ช…์ธ์ง€ ํ™•์ธ
const folder = DriveApp.getFolderById('ํด๋” id'); // ํด๋” id๋ฅผ ํ™•์ธํ•ด์„œ ์ถ”๊ฐ€
const files = folder.getFiles();
const fileMap = {};
@totuworld
totuworld / sendEmail.js
Last active April 10, 2023 14:46
์ด๋ฉ”์ผ ์ „์†ก์šฉ apps script
function sendEmail() {
const ss = SpreadsheetApp.getActiveSpreadsheet()
const sheet1 = ss.getSheetByName('list'); // ์ด๋ฉ”์ผ ๋ณด๋‚ผ ์‚ฌ๋žŒ๋“ค ๋ชฉ๋ก์ด ๋“ค์–ด๊ฐ„ ์‹œํŠธ๋ช…!
const sheet2 = ss.getSheetByName('template'); // ์ด๋ฉ”์ผ ๋‚ด์šฉ์ด ๋“ค์–ด๊ฐ„ ์‹œํŠธ๋ช…!
const subject = sheet2.getRange(2,1).getValue(); // ์ด๋ฉ”์ผ ์ œ๋ชฉ ์ถ”์ถœ
const n = sheet1.getLastRow(); // ์ด๋ฉ”์ผ ๋ณด๋‚ผ ๋ช…๋‹จ์ด ์ „์ฒด ๋ช‡ ๋ช…์ธ์ง€ ํ™•์ธ
// 2๋ฒˆ์งธ ํ–‰๋ถ€ํ„ฐ ์ด๋ฉ”์ผ ์ฃผ์†Œ๊ฐ€ ์žˆ๊ธฐ๋•Œ๋ฌธ์— 2๋ฒˆ์งธ ํ–‰๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด์„œ ๋งˆ์ง€๋ง‰ ์ค„๊นŒ์ง€ ๋ฐ˜๋ณตํ•˜๋Š” ๊ตฌ๋ฌธ
for (let i = 2; i < n+1 ; i++ ) {
// ์ด๋ฉ”์ผ ์ฃผ์†Œ๋Š” 2๋ฒˆ์งธ ์—ด์— ์žˆ์œผ๋‹ˆ๊นŒ (i,2)
@totuworld
totuworld / 01-00-code.js
Last active April 24, 2019 01:51
slack-bot-tutorial-code
// ์•„๋ž˜ ์ฝ”๋“œ๋Š” ๊ณต์‹ ๋ฌธ์„œ์—์„œ ๋ฐœ์ทŒ ํ•œ ํ›„ ์•„์ฃผ ์ž‘์€ ์ˆ˜์ •์„ ํ–ˆ๋‹ค.
const { RTMClient } = require('@slack/rtm-api');
const token = process.env.SLACK_BOT_TOKEN;
const rtm = new RTMClient(token);
// Listen for users who join a channel that the bot user is a member of
// See: https://api.slack.com/events/member_joined_channel
rtm.on('member_joined_channel', async event => {
try {
@totuworld
totuworld / gfb_auth_test.cs
Last active March 26, 2018 01:25
firebase tutorial ์ค‘ auth 01, ์ต๋ช…๋กœ๊ทธ์ธ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Firebase;
using Firebase.Auth;
using Firebase.Unity.Editor;
public class gfb_auth_test : MonoBehaviour {
{
"name": "wendy",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"accepts": {
"version": "1.3.3",
"requires": {
"mime-types": "2.1.13",
@totuworld
totuworld / 5th-wedding-anniversary.md
Last active December 2, 2017 14:20
๊ฒฐํ˜ผ 5์ฃผ๋…„, ๋‚˜์˜ ์—ฐ์• , ๊ฒฐํ˜ผ, ์œก์•„์— ๋Œ€ํ•˜์—ฌ

์†”๋กœ ์ƒํ™œ 29๋…„ํ•˜๊ณ  ์ง€๊ธˆ์˜ ์•„๋‚ด๋ฅผ ๋งŒ๋‚˜ ์—ฐ์•  2๋…„ ํ›„ ๊ฒฐํ˜ผํ–ˆ๋‹ค.

์ด ๊ธ€์ด ๋ฐœํ–‰๋˜๋Š” ๋‚ ์ด ๊ฒฐํ˜ผ 5์ฃผ๋…„.

๊ทธ ์‚ฌ์ด ๋งŒ 2์‚ด์ด ๋„˜์€(์ง€๋‚œ์ฃผ) ๋”ธ์•„์ด๊ฐ€ ์ƒ๊ฒผ๊ณ , ๋‘˜์งธ๊ฐ€ ์•„๋‚ด์˜ ๋ณต์ค‘์— ์žˆ๋‹ค.

๋‚ด ๊ฒฝํ—˜์„ ํ† ๋Œ€๋กœ ์—ฐ์• , ๊ฒฐํ˜ผ, ์œก์•„๋ฅผ ํšŒ๊ณ ํ•˜๊ฒ ๋‹ค.

@totuworld
totuworld / GameDevice.js
Last active December 23, 2016 23:07
์ด์„ธ๊ณ„์— ์ง„์ž…ํ•œ ์„œ๋ฒ„ ๊ฐœ๋ฐœ 3๊ฐ• ์ž๋ฃŒ
'use strict';
module.exports = function(sequelize, DataTypes) {
let GameDevice= sequelize.define('GameDevice', {
GameDeviceUID : { type : DataTypes.INTEGER, primaryKey: true, autoIncrement: true},
UUID:{type:DataTypes.STRING(60)},
DeviceType:{type:DataTypes.INTEGER, defaultValue:0},
MainFlag : { type : DataTypes.BOOLEAN, defaultValue:true }
}, {
timestamps: false,