Skip to content

Instantly share code, notes, and snippets.

View rozzzly's full-sized avatar
😫
const refactor = code => refactor(code);

Patrick Lienau rozzzly

😫
const refactor = code => refactor(code);
View GitHub Profile
@atomiks
atomiks / LazyTippy.jsx
Last active October 7, 2024 08:58
Lazy Tippy
// Will only render the `content` or `render` elements if the tippy is mounted to the DOM.
// Replace <Tippy /> with <LazyTippy /> component and it should work the same.
const LazyTippy = forwardRef((props, ref) => {
const [mounted, setMounted] = useState(false);
const lazyPlugin = {
fn: () => ({
onMount: () => setMounted(true),
onHidden: () => setMounted(false),
@ayyybe
ayyybe / ccdl.command
Last active September 12, 2024 02:13
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@JoshuaCWebDeveloper
JoshuaCWebDeveloper / BookModel.js
Created February 28, 2020 04:13
Example for combining the redux-toolkit and redux-orm libraries
/*
* The redux-orm model and redux-toolkit slice are defined together in the same
* class.
* An export scheme similiar to Ducks is used, where the model class is
* exported in place of the reducer function.
*/
import { Model, fk, many, attr } from 'redux-orm';
import { createSlice } from '@reduxjs/toolkit';
@UCyborg
UCyborg / AeroGlassUpdateSymbols.vbs
Created July 28, 2019 11:22
Downloads debug symbols required by Aero Glass if it doesn't have the latest information about internal DWM functions.
Const WindowsFolder = 0
Const SystemFolder = 1
Const TempFolder = 2
Dim objShell, regPath
Set objShell = WScript.CreateObject("WScript.Shell")
regPath = Array("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot10",_
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot10",_
"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot81",_
@iconifyit
iconifyit / PathSplitter.js
Last active January 12, 2024 22:20
Split SVG path data into subpaths.
/**
* This script was taken from a discussion on Google Groups.
* I'm not taking credit for it but sharing it because it is very useful for splitting
* discontinuous absolute paths into continuous subpaths. Where this is particularly
* useful is for importing SVG files into applications like Figma, Sketch, InVision, XD, etc.
*/
/**
* Split discontinuous absolute paths into continuous sub-paths.
*
* Example:
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active June 20, 2024 10:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

Render 1 Render 2 State Preserved?
<>...</> <>{[...]}</> yes (in any level)
<><>...</></> <>...</> no
[...] [[...]] no
[<>...</>]* [...] no
[<>...</>]* <>...</> no
[<>...</>]* <>[...]</> no
[<>...</>]* [[...]] yes
[&lt;&gt;...&gt;]* &lt;&gt;&lt;&gt;...&gt;&gt; yes
@RxDx
RxDx / MacOSLogoutHook.txt
Last active July 18, 2024 02:23
MacOS: Run script before shutdown
Create a file:
$ pico /Users/Shared/logoutHook.sh
File content:
#!/bin/bash
say 'Hasta la vista baby!'
Set exuction permission:
$ sudo chmod +x /Users/Shared/logoutHook.sh