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
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) => { |
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 to insert into script for a google sheet to convert the rows into a JSON API | |
// Step 1: Add the records to the spreadsheet | |
// Step 2: Add the script, authorise script and then publish to web | |
// Step 3: Use generate URL to get an API response | |
// Documentation for this process can be found here: https://developers.google.com/apps-script/guides/web | |
function getSheetData() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet() | |
var sheetData = sheet.getDataRange().getValues() |
NewerOlder