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
// Run this 1st: | |
// - Create a file locally such as unsplash.js | |
// - Paste the contents of this file | |
// - Update your Unsplash access key from https://unsplash.com/developers | |
// - Run `node unsplash.js` | |
import { createApi } from 'unsplash-js'; | |
import { promises as fs } from 'fs'; | |
const unsplash = createApi({ accessKey: '<Your Unsplash Access Key>' }); |
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 response = await fetch("https://pbs.twimg.com/profile_images/1457798886710738944/HWg9ES8r_400x400.jpg") | |
const contentType = response.headers.get("Content-Type"); | |
const blob = await response.blob(); | |
const arrayBuffer = await blob.arrayBuffer(); | |
const buffer = Buffer.from(arrayBuffer); | |
const dataUri = `data:${contentType};base64,${buffer.toString('base64')}`; | |
const upload = await cloudinary.uploader.upload(dataUri); |
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
/* Input */ | |
const recipes = [ | |
{ | |
name: 'Fried Chicken', | |
categories: ['chicken', 'meat'] | |
}, | |
{ | |
name: 'Spinach Pasta', | |
categories: ['pasta', 'vegan'] |
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
# Follow instructions under "Old Builds" here: https://www.chromium.org/getting-involved/download-chromium | |
# Add the version number in the variable below and run the step before needed | |
# "-1" may not show in the actual version number | |
steps: | |
- run: | | |
VERSION_STRING="88.0.4324.96-1" | |
wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${VERSION_STRING}_amd64.deb" | |
sudo dpkg -i "google-chrome-stable_${VERSION_STRING}_amd64.deb" |
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 parseHumanTime(string) { | |
const units = { | |
'm': 'minutes', | |
'min': 'minutes', | |
'mins': 'minutes', | |
'minutes': 'minutes', | |
's': 'seconds', | |
'sec': 'seconds', | |
'secs': 'seconds', | |
'seconds': 'seconds' |
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
{ | |
"info": { | |
"_postman_id": "e0ee1a9f-a83b-4bd0-97f1-3dd00c6cbafe", | |
"name": "Colby's Lord of the Rings API Collection", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Movie", | |
"item": [ |
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
{ | |
"token": "[token]", | |
"job": "notifySlack", | |
"ref": "refs/pull/4/merge", | |
"sha": "[shad]", | |
"repository": "colbyfayock/demo-github-actions", | |
"repository_owner": "colbyfayock", | |
"repositoryUrl": "git://github.com/colbyfayock/demo-github-actions.git", | |
"run_id": 120667610, | |
"run_number": "2", |
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
/** | |
* Loading Animation Snippet | |
*/ | |
.loading { | |
color: transparent; | |
background: linear-gradient(100deg, #eceff1 30%, #f6f7f8 50%, #eceff1 70%); | |
background-size: 400%; | |
animation: loading 1.2s ease-in-out infinite; | |
} |
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
# Example Usage: gpb develop | |
# Removes any branches that were already merged into develop | |
gpb() { | |
BRANCH=$1 | |
BRANCHES_TO_CLEAN=$(git branch --merged=$BRANCH | grep -v $BRANCH) | |
echo "Branches that have been merged to develop:" | |
echo $BRANCHES_TO_CLEAN | |
read -q "REPLY?Remove branches? (y/n)" | |
echo "" |
NewerOlder