Skip to content

Instantly share code, notes, and snippets.

View totuworld's full-sized avatar

totuworld totuworld

View GitHub Profile
@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,
@totuworld
totuworld / config.json
Last active December 23, 2016 07:14
이세계에 진입한 서버 개발 2강 자료
{
"production":{
"host":"url",
"port": 1433,
"dialect": "mssql",
"username": "replace_username",
"password": "replace_password",
"dialectOptions":{
"encrypt": true,
"database":"db"