Skip to content

Instantly share code, notes, and snippets.

View gerrgg's full-sized avatar
💯

Greg Bastianelli gerrgg

💯
View GitHub Profile
function getYoutubeVideoStatus( $video_id ){
/**
* Get the status of a youtube video
* @param string $video_id
* @return string | false
*/
$url = "https://www.googleapis.com/youtube/v3/videos?part=status&id=$video_id&key=YOUR_API_KEY_HERE";
$results = json_decode(file_get_contents($url));
return( isset( $results->items[0]->status->privacyStatus ) ) ? $results->items[0]->status->privacyStatus : false;
@gerrgg
gerrgg / sqooush-cli.sh
Created June 5, 2021 16:43
// use sqooush CLI to automatically compress and resize images within a folder.
for FILE in *; do squoosh-cli --mozjpeg 50 --resize '{width: 1000, height: 1000}' "$FILE"; done;
const handleHeaderLogic = (() => {
const header = document.querySelector('header');
const sections = document.querySelectorAll('.section');
const whereSectionsStartAndEnd = {}
const headerHeight = 132;
let lastPosition = Math.ceil(window.scrollY);
let ticking = false;
// scrolls to section when menu item is clicked
const handleClickOnMenuItems = (() => {