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
| 'use client'; | |
| import * as React from 'react'; | |
| import { useEffect, useMemo, useRef, useState } from 'react'; | |
| import { | |
| addMinutes, | |
| format, | |
| isEqual, | |
| setHours, |
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
| # create a local .env file with the following 4 properties: | |
| # | |
| # MYSQL_DATABASE=<something> | |
| # MYSQL_USER=<something> | |
| # MYSQL_PASSWORD=<something> | |
| # MYSQL_ROOT_PASSWORD=<something> | |
| # | |
| version: "3.8" | |
| services: |
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
| #### | |
| # ZSH function to auto-switch to correct Node version | |
| # https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5 | |
| # | |
| # - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does. | |
| # | |
| # - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING. | |
| # | |
| # - Works correctly if your .nvmrc file contains something relaxed/generic, | |
| # like "4" or "v12.0" or "stable". |
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
| // Usage: <RatingStars init={0} /> | |
| import React, { useState } from "react"; | |
| // Icons used for the rating-icon | |
| import fullStarImg from "./assets/stars/full.png"; | |
| import halfStarImg from "./assets/stars/half.png"; | |
| import emptyStarImg from "./assets/stars/empty.png"; | |
| // Helper to calculate the mouse position on the icon |
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
| // IMPORT | |
| /** | |
| * Imports JSON data to your spreadsheet Ex: IMPORTJSON("http://myapisite.com","city/population") | |
| * @param url URL of your JSON data as string | |
| * @param xpath simplified xpath as string | |
| * @customfunction | |
| */ | |
| function IMPORTJSON(url,xpath){ | |
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
| exports.handler = (event, context, callback) => { | |
| const response = { | |
| statusCode: 301, | |
| headers: { | |
| Location: 'https://google.com', | |
| } | |
| }; | |
| return callback(null, response); | |
| } |
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
| import TwilioSdk from 'twilio' | |
| // Your Account SID from www.twilio.com/console | |
| const accountSid = process.env.TWILIO_ACCOUNT_SID | |
| // Your Auth Token from www.twilio.com/console | |
| const authToken = process.env.TWILIO_AUTH_TOKEN | |
| // instantiate twilio SDK | |
| const twilio = new TwilioSdk(accountSid, authToken) | |
| // use twilio SDK to send text message https://www.twilio.com/docs/libraries/node | |
| exports.handler = (event, context, callback) => { |