Skip to content

Instantly share code, notes, and snippets.

View pugson's full-sized avatar

pugson pugson

View GitHub Profile
@pugson
pugson / constants.ts
Created April 13, 2024 23:09 — forked from matthewmorek/constants.ts
Handling BASE_URLs in Vercel env
const { CI, PORT = 3000, VERCEL_ENV, NEXT_PUBLIC_VERCEL_ENV, VERCEL_URL, NEXT_PUBLIC_VERCEL_URL } = process.env;
export const ENVIRONMENT = VERCEL_ENV || NEXT_PUBLIC_VERCEL_ENV;
const baseDomainSource = CI ? VERCEL_URL : NEXT_PUBLIC_VERCEL_URL;
const baseDomain = baseDomainSource;
let BASE_URL: string;
if (ENVIRONMENT === 'preview') {
import * as React from 'react';
const useIsFirstRender = (): boolean => {
const isFirst = React.useRef(true);
if (isFirst.current) {
isFirst.current = false;
return true;
} else {
@pugson
pugson / github-search-cheatsheet.md
Created December 21, 2022 21:12 — forked from bonniss/github-search-cheatsheet.md
Github search cheatsheet from official docs.

Github Search Cheat Sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search

@pugson
pugson / easing.css
Created August 2, 2018 16:05 — forked from bendc/easing.css
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@pugson
pugson / psiupuxa.rb
Last active August 29, 2015 14:13 — forked from schmich/psiupuxa.rb
# Download desktop-resolution wallpapers from http://psiupuxa.com/
# into the current directory.
require 'nokogiri'
require 'open-uri'
require 'openssl'
require 'uri'
# Uncomment next line if you don't have the Ruby SSL cert bundle installed.
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
# Author - Arjun Variar
# Thanks to Ben for introducing me to fiftyfootshadows, Awesome Wallpapers!!
#!/bin/sh
if [[ -z "$TMP" ]]
then
TMP="/private/tmp"
fi
dir="$HOME/Wallpapers/fiftyfootshadows"