Skip to content

Instantly share code, notes, and snippets.

Peter T Bosse II ptb

Block or report user

Report or block ptb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MyComponent.jsx
import { css } from "@amory/style"
import PropTypes from "prop-types"
import React, { forwardRef, Fragment } from "react"
import styles from "./MyComponent.css.json"
export const MyComponent = forwardRef (
({
"as": Element,
children,
View template.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View deep-merge-map.js
/* eslint-disable no-use-before-define */
const isArr = Array.isArray
const isMap = (value) => value instanceof Map
const isObj = (value) => typeof value === "object"
const canMerge = (value) =>
Boolean (value) &&
isObj (value) &&
!(/^\[object (?:Date|RegExp)\]$/)
View static-site-generator-webpack-plugin.js
/* eslint compat/compat: off, max-statements: off */
const RawSource = require ("webpack-sources/lib/RawSource")
const evaluate = require ("eval")
const path = require ("path")
const cheerio = require ("cheerio")
const url = require ("url")
const Promise = require ("bluebird")
const findAsset = (src, compilation, webpackStatsJson) => {
View .gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
View .babelrc
{
"presets": [
"env"
]
}
View adblock.sh
unset LANG; adblock () { test -n "$1" && curl --compressed --location --silent 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist' 'https://github.com/azet12/KADhosts/raw/master/KADhosts.txt' 'https://github.com/FadeMind/hosts.extras/raw/master/add.2o7Net/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/add.Dead/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/add.Risk/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/add.Spam/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/SpotifyAds/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/UncheckyAds/hosts' 'https://github.com/mitchellkrogza/Badd-Boyz-Hosts/raw/master/hosts' 'https://github.com/StevenBlack/hosts/raw/master/data/StevenBlack/hosts' 'https://github.com/tyzbit/hosts/raw/master/data/tyzbit/hosts' 'https://www.malwaredomainlist.com/hostslist/hosts.txt' 'https://mirror1.malwaredomains.com/files/justdomains' 'http://adblock.mahakala.is/' 'https://s3.amazonaws.com/lists.disconnect.me/s
View .zshrc
#!/bin/sh
#-- Exports ----------------------------------------------------
export \
HISTFILE="${ZDOTDIR:-$HOME}/.zhistory" \
HISTSIZE=50000 \
SAVEHIST=50000
#-- Changing Directories ---------------------------------------
View gist:b401cb030b321524f3463b96c122262c
init_sudo
init_cache
init_no_sleep
init_hostname
init_perms
init_devtools
init_updates
init_mas_save
install_paths
install_brew
View ask.sh
#!/bin/sh
function ask() {
function y() { printf " \e[3;32m%s\e[0m\n" "yes"; }
function n() { printf " \e[3;31m%s\e[0m\n" "no"; }
printf "\e[1;34m%s\e[0m? \e[1;33m%s\e[0m " "${1}" "(y/n)"
for i in {1..3}; do
read -s -n 1 -t 2
case "$REPLY" in
You can’t perform that action at this time.