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 / whisper-mock-en.ipynb
Last active November 23, 2022 15:55
whisper-mock-en.ipynb
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 {
@Kazuki-tam
Kazuki-tam / tewatashi.css
Last active December 25, 2021 16:17
テワタシUIカスタマイズ用CSS
/* テワタシUIカスタマイズ用CSS */
/* {{ 'tewatashi.css' | asset_url | stylesheet_tag }} をtheme.liquidに挿入してください */
/* 選択なしを非表示にしたい場合以下を記述 */
.tewatashi-checkout-method--theme-app-extension select>option:nth-of-type(2),
.tewatashi-checkout-method select>option:nth-of-type(2) {
display: none;
}
@Kazuki-tam
Kazuki-tam / delivery-time.liquid
Created July 9, 2021 06:17
カレンダーマスターdelivery-time.liquid
{% comment %} このファイルを直接編集することはできません。 {% endcomment %}
<!-- 配送時間の選択肢表示 -->
<div class="app-deliverydate app-deliverydate--time">
<label for="delivery_time" class="delivery_time">配送時間を選択</label>
<select id="delivery_time" name="attributes[delivery_time]" value="{{ cart.attributes.delivery_time }}" style="">
<option>指定なし</option>
</select>
</div>
@Kazuki-tam
Kazuki-tam / dynamicCheckoutCart
Last active June 4, 2021 05:15
Shopify動的チェックアウト対策
<script>
"use strict";
const deliveryDateInput = document.querySelector('#delivery_date_input');
const deliveryTimeInput = document.querySelector('#delivery_time');
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (deliveryDateInput.value !== null) {
updateDeliveryDate();
}