Skip to content

Instantly share code, notes, and snippets.

View Kazuki-tam's full-sized avatar

Kazuki-tam Kazuki-tam

View GitHub Profile
@Kazuki-tam
Kazuki-tam / customFuncFigmaImageUrl.gs
Created October 24, 2024 06:56
customFuncFigmaImageUrl
var global=this;
function FIGMA_IMAGE_URL() {
}
(() => {
// src/figma/getFigmaImage.ts
function getFigmaImage(targetId, figmaFileKey, figmaApiToken) {
try {
const imageResponse = UrlFetchApp.fetch(`https://api.figma.com/v1/images/${figmaFileKey}?ids=${targetId}&format=jpg`, {
headers: {
"X-Figma-Token": figmaApiToken
@Kazuki-tam
Kazuki-tam / customMenu.gs
Created October 24, 2024 06:48
customMenu
var global=this;
function onOpen() {
}
(() => {
// src/sheet/createCustomMenu.ts
function createCustomMenu() {
const ui = SpreadsheetApp.getUi();
const userLocale = Session.getActiveUserLocale();
const menuTitle = "Figma2Sheet";
let menuItemTitle1 = "Insert Figma Image";
name: PR Agent
on:
# プルリクが「オープン」「再オープン」「コミット追加」時に自動起動
pull_request:
types: [opened, reopened, synchronize]
issue_comment:
jobs:
pr_agent_job:
if: ${{ github.event.sender.type != 'Bot' }}
runs-on: ubuntu-latest
@Kazuki-tam
Kazuki-tam / whisper-mock-en.ipynb
Last active November 23, 2022 15:55
whisper-mock-en.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Kazuki-tam
Kazuki-tam / testEmail.gs
Last active February 27, 2022 13:28
gas-spreadsheet-mail-02
function testEmail(){}(()=>{"use strict";var e,t,a={598:(e,t)=>{t.__esModule=!0,t.sendEmailToAll=void 0,t.sendEmailToAll=function(e,t,a,r){var i=SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Email Content"),n=SpreadsheetApp.getUi();if(i){for(var l="",o="",s="",d="",c=i.getLastRow()-1,p=0;p<c;p++){var g=i.getRange(2+p,1).getValue(),u=i.getRange(2+p,2).getValue();"CC"===g&&(s=u),"BCC"===g&&(d=u),"Subject"===g&&(l=u),"Body"===g&&(o=u.replace("{COMPANY}",t).replace("{DEPARTMENT}",a).replace("{PIC}",r))}var m={cc:s,bcc:d};GmailApp.sendEmail(e,l,o,m),n.alert("📤 Sent email","It's done!",n.ButtonSet.OK)}else n.alert("🚨 The sheet name may be incorrect. It should be Email Content.")}},506:(e,t)=>{t.__esModule=!0,t.validateEmail=void 0,t.validateEmail=function(e){return/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]+.[A-Za-z0-9]+$/.test(e)}}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return a[e](n,n.exports,i),n.exports}i.g=function(){if("object"==typeof globalThis)re
@Kazuki-tam
Kazuki-tam / sendEmail.gs
Last active February 27, 2022 13:27
gas-spreadsheet-mail-01
function main(){}(()=>{"use strict";var e,t,a,r={598:(e,t)=>{t.__esModule=!0,t.sendEmailToAll=void 0,t.sendEmailToAll=function(e,t,a,r){var n=SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Email Content"),i=SpreadsheetApp.getUi();if(n){for(var l="",o="",s="",c="",d=n.getLastRow()-1,u=0;u<d;u++){var p=n.getRange(2+u,1).getValue(),g=n.getRange(2+u,2).getValue();"CC"===p&&(s=g),"BCC"===p&&(c=g),"Subject"===p&&(l=g),"Body"===p&&(o=g.replace("{COMPANY}",t).replace("{DEPARTMENT}",a).replace("{PIC}",r))}var m={cc:s,bcc:c};GmailApp.sendEmail(e,l,o,m),i.alert("📤 Sent email","It's done!",i.ButtonSet.OK)}else i.alert("🚨 The sheet name may be incorrect. It should be Email Content.")}},690:(e,t)=>{t.__esModule=!0,t.checkDuplicate=void 0,t.checkDuplicate=function(e){return e.filter((function(e,t,a){return a.indexOf(e)===t&&t!==a.lastIndexOf(e)}))}},506:(e,t)=>{t.__esModule=!0,t.validateEmail=void 0,t.validateEmail=function(e){return/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]+.[A-Za-z0-9]+$/.test(e)}}},n={};fun
@Kazuki-tam
Kazuki-tam / attribute-reset.js
Last active February 16, 2022 14:14
カレンダーマスター&テワタシデータ初期化処理
// リセット関数
function resetData() {
const attr = {
attributes: {
'delivery_date': null,
'delivery_time': null,
'受け渡し方法': null,
'受け渡し日': null,
'受け渡し時間': null,
'受け渡し曜日': null,
@Kazuki-tam
Kazuki-tam / calendarMaster_checkout.liquid
Created February 11, 2022 15:22
Shopifyカレンダーマスター_注文確認画面スクリプト
<script>
var date = {{ attributes.delivery_date | json }} || "指定なし";
var time = {{ attributes.delivery_time | json }} || "指定なし";
Shopify.Checkout.OrderStatus.addContentBox(
'<h3>配送希望日時</h3>',
`<p>${date} ${time}</p>`
)
</script>
@Kazuki-tam
Kazuki-tam / toggle-tab.html
Created December 28, 2021 16:59
Toggle Tab HTML
<div id="sample-tab">
<ul class="sample-Tab-nav" role="tablist">
<li role="presentation">
<button role="tab" aria-controls="panel1" aria-selected="true" tabindex="0">
Tab 1
</button>
</li>
<li role="presentation">
<button role="tab" aria-controls="panel2" aria-selected="false" tabindex="-1">
Tab 2
@Kazuki-tam
Kazuki-tam / toggle-tab.ts
Last active December 30, 2021 07:58
Toggle Tab Function in Vanilla TypeScript
/**
* Tab Function
* @param { String } wrapperId - Wrapper contet's ID
* ex: tab('sample-tab');
* Note: Control UI elements with aria-* attributes
* [aria-hidden='true'] {display: none;}
* [aria-hidden='false'] {display: block;}
*/
function tab(wrapperId: string): void {