Skip to content

Instantly share code, notes, and snippets.

View jinsley8's full-sized avatar

Jon Insley jinsley8

View GitHub Profile
@rahuldamodar94
rahuldamodar94 / gist:6bdd022f3457934f2a104fd5f4bb45e4
Created December 16, 2020 02:21
0x V3 deployment on Matic Testnet (Mumbai - 80001) and Matic Mainnet (137)
"80001":{
"erc20Proxy": "0x0b47076aaa5246411458fcf85494f41bbfdb8470",
"erc721Proxy": "0xff7ca10af37178bdd056628ef42fd7f799fac77c",
"erc1155Proxy": "0x53d791f18155c211ff8b58671d0f7e9b50e596ad",
"zrxToken": "0x5af2b282779c7d4ffc69ca4e6e16676747f5c56b",
"etherToken": "0x5b5e11e4818cceba3e82ca9b97cd0ab80be75ad3",
"exchange": "0x533dc89624dcc012c7323b41f286bd2df478800b",
"erc20BridgeProxy": "0x5638a4b19f121adc4436de3f0e845173b33b594c",
"forwarder": "0x6dcf02d3a963f22dbf85c4025b86a834fef16c15",
"coordinatorRegistry": "0x6f5b9e0456c4849224c7b59dc15f05c48641c4e3",
@Froelund
Froelund / _error.tsx
Last active November 30, 2023 04:35
Next.js Typescript error reporting
import { captureException, flush } from '@sentry/nextjs';
import NextErrorComponent from 'next/error';
import type { ErrorProps } from 'next/error';
import type { NextPage } from 'next';
interface AppErrorProps extends ErrorProps {
err?: Error;
hasGetInitialPropsRun?: boolean;
}
@wojtekmaj
wojtekmaj / .gitignore
Last active May 2, 2025 16:46
How to upgrade Yarn to Yarn Modern (v4 at the moment) seamlessly
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
@SuryawanshiPrajakta
SuryawanshiPrajakta / child-categories.txt
Created June 30, 2020 12:12
Display only sub-categories in Taxonomy Badge
Add the following filter in your active child theme's functions.php file
add_filter( 'uael_posts_tax_filter', function( $terms ) {
$child_terms = array();
$terms = wp_get_post_terms( get_the_ID(), 'category' );
foreach( $terms as $term ){
if( $term->parent !== 0 ){
array_push( $child_terms, $term );
import useSWR, { ConfigInterface, responseInterface } from 'swr'
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'
export type GetRequest = AxiosRequestConfig | null
interface Return<Data, Error>
extends Pick<
responseInterface<AxiosResponse<Data>, AxiosError<Error>>,
'isValidating' | 'revalidate' | 'error'
> {
add_filter('is_enable_wallet_partial_payment', '__return_true');
add_filter('is_valid_payment_through_wallet', '__return_false');
add_filter('woo_wallet_partial_payment_amount', 'woo_wallet_partial_payment_amount_callback', 10);
function woo_wallet_partial_payment_amount_callback($amount) {
if (sizeof(wc()->cart->get_cart()) > 0) {
$cart_total = get_woowallet_cart_total();
$partial_payment_amount = ($cart_total * 20) / 100;
if ($amount >= $partial_payment_amount) {
$amount = $partial_payment_amount;
@mgibbs189
mgibbs189 / test.js
Last active October 20, 2022 20:49
FacetWP - show reset button only when facets are selected
<script>
/*
Code placement: see the "Javascript" section on https://facetwp.com/how-to-use-hooks/
This assumes that your reset button looks like this:
<a class="my-reset-btn" onclick="FWP.reset()">RESET</a>
*/
(function($) {
@pitabas106
pitabas106 / zeta-woo-change-quantity.php
Last active February 16, 2022 06:33
WooCommerce: Customers can change the quantity & delete it on checkout page.
<?php
/**
* WooCommerce: Customers can change the quantity & delete it on checkout page.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active April 30, 2025 07:51
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user