Skip to content

Instantly share code, notes, and snippets.

@AimWhy
AimWhy / MutateRuntimePlugin.js
Created November 1, 2021 09:10 — forked from ScriptedAlchemy/MutateRuntimePlugin.js
Remote PublicPath Modification
const PLUGIN_NAME = "MutateRuntimePlugin";
class MutateRuntimePlugin {
/**
*
* @param {FederationDashboardPluginOptions} options
*/
constructor(options) {}
/**
@AimWhy
AimWhy / useScroll.js
Created June 4, 2021 08:38 — forked from joshuacerbito/useScroll.js
Custom React hook for listening to scroll events
/**
* useScroll React custom hook
* Usage:
* const { scrollX, scrollY, scrollDirection } = useScroll();
*/
import { useState, useEffect } from "react";
export function useScroll() {
const [lastScrollTop, setLastScrollTop] = useState(0);
@AimWhy
AimWhy / useSlot.jsx
Created June 2, 2021 06:41 — forked from walter0331/useSlot.jsx
react useSlot hook
const useSlot = (children) => {
/**
* map slots
*/
const slots = React.Children.toArray(children)
.reduce((result, child) => {
if (child.props && child.props.slot) {
result[child.props.slot] = child;
} else {
result.default.push(child);
@AimWhy
AimWhy / pr.md
Created September 19, 2019 05:39 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@AimWhy
AimWhy / iterm2-solarized.md
Created August 25, 2019 14:57 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@AimWhy
AimWhy / auto-deploy.md
Created January 30, 2019 02:15 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.