Skip to content

Instantly share code, notes, and snippets.

@krooluang
krooluang / gs
Created June 24, 2024 12:17
GoogleAppscript Slider /ภาพสไลด์
function doGet() {
return HtmlService.createTemplateFromFile('index')
.evaluate()
.setTitle('Slider')
.addMetaTag('viewport', 'width=device-width, initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
function getImagesFromSheet() {
const folderId = "xxx" //เปลี่ยนไอดีโฟลเดอร์
@krooluang
krooluang / gs
Last active June 24, 2024 11:56
ระบบคัดลอกข้อความ
function doGet() {
return HtmlService.createHtmlOutputFromFile('index')
.setTitle('copy Examblog')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
.addMetaTag('viewport', 'width=device-width, initial-scale=1');
}
@krooluang
krooluang / gs
Last active June 19, 2024 05:06
TestOnline Examblog
function doGet() {
return HtmlService.createTemplateFromFile('index')
.evaluate()
.setTitle('TestOnline Examblog')
.addMetaTag('viewport', 'width=device-width, initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
// This function retrieves questions from 'Sheet1' in the active Google Sheets document.
function getQuestions() {
<!DOCTYPE html>
<html lang="en">
<head>
<base target="_top">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.6.4.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" />
<style>
@import url('https://fonts.googleapis.com/css2?family=Sarabun&display=swap');
@krooluang
krooluang / gsForm กำหนดเงื่อนไขผ่าน ไม่ผ่าน
Last active July 2, 2023 04:24
Form กำหนดเงื่อนไขผ่าน/ไม่ผ่าน แนบไฟล์
function doGet() {
return HtmlService.createTemplateFromFile('index')
.evaluate()
.setTitle('FormSubmit')
.addMetaTag('viewport', 'width=device-width, initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
var folder = DriveApp.getFolderById('xxx') //ChangeIdFolder
//Database : https://docs.google.com/spreadsheets/d/1Lyv3gWZHsfl9gcLNBil4oIjEAKp-gI2ED79C-tbV0EY/copy
function doGet() {
return HtmlService.createTemplateFromFile('index')
.evaluate()
.setTitle('FormSubmit')
.addMetaTag('viewport', 'width=device-width, initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
<!DOCTYPE html>
<html lang="en">
<head>
<base target="_top">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
@krooluang
krooluang / Quick search no time
Last active May 14, 2023 04:35
Quick search no time
// Database https://docs.google.com/spreadsheets/d/1WvnuQH6eBMXBmTDJZG3VFQlNymtrao7aDU7fv4JIheI/copy
//code.gs
function doGet() {
return HtmlService.createTemplateFromFile('index').evaluate()
.addMetaTag('viewport', 'width=device-width, initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
/** ตัวแปรดึงข้อมูลในชีต */
function getDataSheet() {
@krooluang
krooluang / Loginแยก User
Created May 4, 2023 05:42
Loginแยก User
//https://www.facebook.com/groups/exambloggas
//Database: https://docs.google.com/spreadsheets/d/1SjcYR7CKMT7cZSkrNxiRH1ZTWJdfusQQ49kTb96qa6I/copy
function doGet() {
return HtmlService.createTemplateFromFile('index')
.evaluate()
.addMetaTag('viewport', 'width=device-width, initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
@krooluang
krooluang / CRUD credit Bpwebs code.gs
Last active November 9, 2024 12:01
CRUD Bpwebs DataTable Style
//code.gs
/**
* Creating a Google Sheets Data Entry Form for CRUD Operations
* By: bpwebs.com
* Post URL: https://www.bpwebs.com/crud-operations-on-google-sheets-with-online-forms
* Dev Examblog : https://examblog64.krooluang.com
*/
//CONSTANTS
const SPREADSHEETID = "xxx";