This file contains 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
#! /bin/bash | |
read -p "Please enter in the full number " assignedNumber | |
smsExportFile="$assignedNumber"_Responses_$(date +'%Y-%m-%d')".csv" | |
twilio api:core:messages:list --to=$number --properties=body,from,dateSent -o=tsv > $smsExportFile | |
# no need to custom parse the JSON |
This file contains 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 onEdit({source, range}) { | |
const { | |
columnStart, | |
rowStart | |
} = range | |
const nextCellR1C1Notation = `R${rowStart}C${columnStart + 1}` | |
if (columnStart == 3) { |
This file contains 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
{% set contactNumber = "" %} | |
{% for contact in Sale.Customer.Contact.Phones.ContactPhone %} | |
{% if contact.number != "" and contactNumber == "" %} | |
{% set contactNumber = contact.number %} | |
{% endif %} | |
{% endfor %} | |
<span> Customer Number: {{contactNumber}} </span> |
This file contains 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 getBaseDescription = async() =>{ | |
const baseURL = window.location.origin | |
const [accountID, itemID] = window.location.href.match(/\d+/g) | |
const descriptionNode = document.querySelector('.description') |
This file contains 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
// Gets the custom fields for the label template in Lightspeed Retail: | |
// Function to get custon field values | |
const requestBuilder = async (domain, RAD, endpoint, ID, parameters, isDisplay) => { | |
const url = isDisplay | |
? endpoint == "Label" | |
?`https://${domain}/API/Account/${RAD}/DisplayTemplate/ItemAs${endpoint}/${ID}.json?${parameters}` | |
:`https://${domain}/API/Account/${RAD}/DisplayTemplate/${endpoint}/${ID}.json?${parameters}` | |
:`https://${domain}/API/Account/${RAD}/${endpoint}/${ID}.json?${parameters}` |
This file contains 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 birthdayMessage() { | |
const sheet = SpreadsheetApp.openById("someID"); | |
const [headers, ...birthdays] = sheet.getDataRange().getValues(); | |
// removing rows without dates | |
const cleanedList = birthdays.filter(([,date]) => date != "") | |
const todaysBirthdays = cleanedList.reduce((matchedBirthdays, currentBirthday) => { |
This file contains 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
package main | |
import ( | |
"fmt" | |
) | |
//Option 1 | |
func recursiveLoop(list []int, currentIndex int) { | |
if !(currentIndex == len(list)) { | |
fmt.Println(list[currentIndex]) |
This file contains 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 getImages() { | |
const sheet = SpreadsheetApp.openById(ID); | |
const db = DriveApp.getFolderById(ID) | |
const dbFiles = db.getFiles(); | |
while (dbFiles.hasNext()) { | |
const file = dbFiles.next() | |
const driveURL = file.getUrl() | |
const { |
This file contains 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 getRandomNumber(min, max, blockList) { | |
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min; | |
if (blockList.includes(randomNumber)) return getRandomNumber(min, max, blockList) | |
return randomNumber | |
} | |
// Example on how to use |
This file contains 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 getMatchingBibleBooks = async (passage) => { | |
const bibleSite = "https://www.biblegateway.com/passage/bbl/?version=NKJV&locale=en" | |
if (window.location.href != bibleSite) window.location.href = bibleSite | |
const getPage = await fetch(bibleSite) | |
const getJSONPage = await getPage.json() | |
const bibleBooks = getJSONPage.testaments.reduce((bookNames, currentTestament) => { |
NewerOlder