const arrayToObj = <T extends { id: number }>(array: T[]): { [k: string]: T } => {
const out: { [k: string]: T } = {};
array.forEach((val) => {
out[val.id] = val;
});
return out;
};
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* APPS SCRIPT */ | |
| function doPost(e) { | |
| var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("inqueries"); | |
| var name = e.parameter.name.trim(); | |
| var email = e.parameter.email; | |
| var phone = e.parameter.phone || ""; // Optional, may be empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Hugging FaceからのモデルをOllamaで実行する方法 | |
| ## 参照:https://www.markhneedham.com/blog/2023/10/18/ollama-hugging-face-gguf-models | |
| ## Ollamaをゲット:https://ollama.com/download | |
| # 1. hugging faceのCLIを取得 | |
| ## pipの場合 | |
| pip install -U "huggingface_hub[cli]" | |
| ## pip3の場合は:pip3 install -U "huggingface_hub[cli]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function installTrigger() { | |
| ScriptApp.newTrigger('onFormSubmit') | |
| .forSpreadsheet(SpreadsheetApp.getActive()) | |
| .onFormSubmit() | |
| .create(); | |
| } | |
| const fakeSubmission = {"authMode":"FULL","namedValues":{"Your Name":["Claire"],"GitHub username":["clairefro"],"Timestamp":["9/20/2021 9:55:20"]},"range":{"columnEnd":3,"columnStart":1,"rowEnd":3,"rowStart":3},"source":{},"triggerUid":"3209236967361824985","values":["9/20/2021 9:55:20","Claire","clairefro"]} | |
| function testSubmission() { |
index.html
<div class="opening-screen">Tengo hambre</div>
<button class="option-one-button">Dormir</button>
<button class="option-two-button">Comer un sándwich</button>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Expects email to column to be first column of selected range */ | |
| /** Does not account for bounces */ | |
| function sendEmailsWithTrackingPixel() { | |
| /** Update these values */ | |
| const POSTMAN_FLOW_WEBHOOK_URL = 'https://fooooooooooooooooooo.flow.pstmn.io' | |
| const COL_SUBJECT = 3 // integer representing the absolute column number for email subject | |
| const COL_BODY = 4 // integer representing the absolute column number for email body | |
| const COL_ID = 5 // integer representing the absolute column number for placement of unqiue mail merge ID | |
| const COL_STATUS = COL_ID + 1 // integer representing the absolute column number for mail merge status. Defaults to right of ID col |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("dotenv").config(); | |
| const Discord = require("discord.js"); | |
| const DISCORD_STUDENT_EXPERT_ROLE_ID = | |
| process.env.DISCORD_STUDENT_EXPERT_ROLE_ID; | |
| const DISCORD_STUDENT_LEADER_ROLE_ID = | |
| process.env.DISCORD_STUDENT_LEADER_ROLE_ID; | |
| if ( | |
| !process.env.DISCORD_BOT_TOKEN || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Run this ONCE to install make the app listen for the form submission trigger | |
| function installTrigger() { | |
| ScriptApp.newTrigger('onFormSubmit') | |
| .forSpreadsheet(SpreadsheetApp.getActive()) | |
| .onFormSubmit() | |
| .create(); | |
| } | |
| // Used for manual testing only. Simulates a real form submission | |
| const fakeSubmission = {"authMode":"FULL","namedValues":{"Your Name":["Claire"],"GitHub username":["clairefro"],"Timestamp":["9/20/2021 9:55:20"]},"range":{"columnEnd":3,"columnStart":1,"rowEnd":3,"rowStart":3},"source":{},"triggerUid":"3209236967361824985","values":["9/20/2021 9:55:20","Claire","clairefro"]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const testsPassedTemplate = ` | |
| <div class="container"> | |
| <h3>All tests passed! 🚀</h3> | |
| <p>Congratulations! You've completed {{workshopCode}}. If you've registered for the classroom program, enter the <strong>same email you used in registration</strong> below to submit your progress to your teacher</p> | |
| <form onsubmit="handleSubmit(event)"> | |
| <input type="email" name="email" placeholder="Enter your email" required /> | |
| <input type="submit" id="submit-button"/> | |
| </form> | |
| </div> |
NewerOlder