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
export default { | |
mode: 'universal', | |
head: { | |
titleTemplate: titleChunk => `${titleChunk ? `${titleChunk} | ` : ''}` + 'Site', | |
meta: [ | |
{ charset: 'utf-8' }, | |
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }, | |
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }, | |
{ property: 'og:title', content: 'Site (embed test!)' }, | |
{ property: 'og:site_name', content: 'Site' } |
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
/** | |
* Checks truthiness of any set of inputs | |
* | |
* @param {Array<boolean | Function>} operands Values to check | |
* @param {'all' | 'one'} mode | |
* | |
* @returns {boolean} | |
*/ | |
function allTrue(operands, mode = 'all') { | |
/** |
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
/* | |
Output will be formatted like | |
[ 'file', 'directory/file.ts', 'directory/subdir/otherfile.ts', 'directory/subdir/file.txt' ] | |
*/ | |
function readdirSyncRecurse (directory) { | |
const output = [] | |
const items = fs.readdirSync(directory) | |
for (const item of items) { |
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
!!! TWITTER GOODIFIER | |
!! any rule (starting with "twitter.com##") you want to enable, remove the "!" at the start of the line | |
!! Remove "Explore" link from left navbar | |
twitter.com##header a[href="/explore"] | |
!! Remove unread Notifications indicator from sidebar | |
! twitter.com##header a[href="/notifications"] div > svg + [aria-label*="unread" i] | |
!! Remove unread DM indicator from sidebar | |
! twitter.com##header a[href="/messages"] div > svg + [aria-label*="unread" i] |
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
import React, { ComponentPropsWithRef } from "react"; | |
import { RiAlertLine } from "react-icons/ri"; | |
import styled, { css } from "styled-components"; | |
export interface TextInputProps | |
extends ComponentPropsWithRef<typeof InnerInput> { | |
label: string; | |
id: string; | |
error?: string; | |
} |
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
# installs winget on Windows Server | |
# stolen from https://github.com/actions/runner-images/issues/910#issuecomment-1291001212 | |
Invoke-WebRequest -Uri 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx' -OutFile 'VCLibs.appx' # automatically downloads latest version | |
Invoke-WebRequest -Uri 'https://github.com/microsoft/winget-cli/releases/download/latest/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle' -OutFile 'winget.msixbundle' | |
$ReleaseInfo = Invoke-RestMethod 'https://api.github.com/repos/microsoft/winget-cli/releases/latest' | |
Invoke-WebRequest -Uri $ReleaseInfo.assets.Where({ $_.name.EndsWith('License1.xml') }).browser_download_url -OutFile 'license.xml' # because the prefix of the file changes with every release | |
Add-AppxProvisionedPackage -Online -PackagePath winget.msixbundle -LicensePath license.xml -DependencyPackagePath VCLibs.appx |