Skip to content

Instantly share code, notes, and snippets.

View songwutk's full-sized avatar

songwutk

  • Phrae Hospital
  • Phrae,Thailand
View GitHub Profile
@songwutk
songwutk / LINE-BOT-GAS-SAMPLE.js
Last active May 24, 2020 11:01 — forked from nwatab/LINE-BOT-GAS-SAMPLE.js
Supporterz 2 and 24, October, 2018
We couldn’t find that file to show.
function doGet(e){
var op = e.parameter.action;
var ss=SpreadsheetApp.openByUrl("ใส่ url ของชีต");//////////////
var sheet = ss.getSheetByName("แผ่น1");
if(op=="insert")
return insert_value(e,sheet);
if(op=="read")
function onOpen() {
let ui = SpreadsheetApp.getUi()
ui.createMenu("PDF")
.addItem("สร้าง PDF", "pdfForm")
.addItem("สร้าง PDF ทั้งหมด", "pdfFormAll")
.addToUi()
}
function pdfFormAll(){
let docId = 'ID ของ Google Docs';
let sheetId = 'ID ของ Google Spreadsheet';
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@songwutk
songwutk / simple-json-reponse.php
Created March 25, 2021 01:48 — forked from james2doyle/simple-json-reponse.php
A simple JSON response function for PHP. Used in various PhileCMS plugins.
<?php
function json_response($code = 200, $message = null)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900");
@songwutk
songwutk / code.gs
Created June 2, 2021 08:43 — forked from neno-tech/code.gs
CRUD Web App Full 2021
var sheetID = 'xxx'//แก้จุดที่1
function doGet(e) {
if (!e.parameter.page || e.parameter['page']=='index') {
var htmlOutput = HtmlService.createTemplateFromFile('index')
htmlOutput.message = '';
return htmlOutput.evaluate()
.setTitle("web app")
.addMetaTag('viewport', 'width=device-width , initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
@songwutk
songwutk / CSS.html
Created August 12, 2021 23:26 — forked from neno-tech/CSS.html
เว็บแอป CRUD อัปโหลดโค้ดวันแม่ 2564
<style>
.btn-group-xs > .btn, .btn-xs {
padding: .25rem .4rem;
font-size: .875rem;
line-height: .5;
border-radius: .2rem;
}
</style>
@songwutk
songwutk / code1.gs
Created August 14, 2021 15:05 — forked from neno-tech/code1.gs
สร้าง API จาก GOOGLE SHEET และสร้าง API สำหรับเพิ่มข้อมูลลงใน GOOGLE SHEET
var ss = SpreadsheetApp.openById('xxx')
var sheet = ss.getSheetByName('xxx')
function doGet(e) {
var action = e.parameter.action
if (action == 'getUsers') {
return getUsers(e)
}
}
/*
1) Open https://popcat.click
2) Open console (F12)
3) Insert code & run
*/
var event = new KeyboardEvent('keydown', {
key: 'g',
ctrlKey: true
@songwutk
songwutk / code.gs
Created October 11, 2021 14:34 — forked from neno-tech/code.gs
Responsive web app Book Store
function doGet(e) {
return HtmlService.createTemplateFromFile('index').evaluate()
.addMetaTag('viewport','width=device-width , initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename).getContent();
}