Skip to content

Instantly share code, notes, and snippets.

View Quinncuatro's full-sized avatar
https://HenryNeeds.Coffee

Henry Quinn Quinncuatro

https://HenryNeeds.Coffee
View GitHub Profile
@joshcawthorne
joshcawthorne / useWindowSize.js
Last active October 5, 2023 13:21
SSR-Compatible (NextJS, Gatsby etc) React hook for getting Window Size.
import { useState, useEffect } from "react";
function useWindowSize() {
const [windowSize, setWindowSize] = useState<{ width: number | undefined; height: number | undefined }>({
width: undefined,
height: undefined,
});
useEffect(() => {
function handleResize() {
@hoesler
hoesler / install_jenkins_plugin.sh
Last active February 9, 2024 16:28 — forked from micw/install_jenkins_plugin.sh
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/usr/bin/env bash
set -e
set -o pipefail
plugin_repo_url="http://updates.jenkins-ci.org/download/plugins"
plugin_dir="/var/lib/jenkins/plugins"
include_optionals=false
showUsage() {
@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins