A Pen by Joseph Bacal on CodePen.
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 fetch = require('node-fetch') | |
| function deCloudinaried(url){ | |
| const urlTokenized = url.split('/') | |
| urlTokenized.splice(3,1) | |
| const basicUrl = urlTokenized.join('/') | |
| return basicUrl | |
| } | |
| let urls = [ |
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 { | |
| getArtistIdMap, | |
| getFeedItems, | |
| createDocsFromItems | |
| } from './artistUtils' | |
| let artistIdsMap; | |
| let feedItems; | |
| let startingIndex; | |
| let endingIndex; |
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
| // with thanks to https://github.com/Urigo/graphql-modules/blob/8cb2fd7d9938a856f83e4eee2081384533771904/website/lambda/contact.js | |
| const process = require('process') | |
| const { promisify } = require('util') | |
| const sendMailLib = require('sendmail') | |
| const { validateEmail, validateLength } = require('./validations') | |
| const sendMail = promisify(sendMailLib()) |
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 process = require('process') | |
| const sanityClient = require('@sanity/client') | |
| // You will need to configure environment variables for Sanity.io project id, | |
| // dataset name, and a token with write access. The variables are named | |
| // | |
| // SANITY_PROJECTID | |
| // SANITY_DATASET | |
| // SANITY_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
| /* grab objects for data, template, and target folder */ | |
| MY_VALUES = SpreadsheetApp.getActiveSpreadsheet().getRange('replace_this_string_with_range_in_A1_notation').getValues(); | |
| MY_TEMPLATE = DriveApp.getFileById('replace_this_string_with_fileid'); | |
| MY_FOLDER = DriveApp.getFolderById('replace_this_string_with_folderid'); | |
| /* timestamp function */ | |
| function niceStamp(){ | |
| return Utilities.formatDate(new Date(), "GMT-4", "MM-dd-yy ' at ' HH:mm:ss "); | |
| } |
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
| defmodule Food do | |
| def test_food(%{ name: "raisins"} = food) do | |
| "The food is tiny, gross #{food.name}. It tastes #{food.taste}." | |
| end | |
| def test_food(food) do | |
| "The food is #{food.name}. It tastes #{food.taste}." | |
| end | |
| end |
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 gspread | |
| from oauth2client.service_account import ServiceAccountCredentials | |
| from .models import Student | |
| class StudentDetailView(DetailView): | |
| model = Student | |
| template_name = 'student_detail.html' | |
| def get_context_data(self, *args, **kwargs): | |