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
/** | |
* This script/codemod transforms imports from barrel files into direct imports. | |
* It's designed to work with jscodeshift to modify TypeScript/JavaScript files. | |
* | |
* Features: | |
* - Handles multiple barrel files | |
* - Transforms both value and type imports | |
* - Maintains correct relative paths | |
* - Handles re-exports within barrel files | |
* |
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
// ========================================== | |
// (WIP) TYPE-SAFE ISO 3166 COUNTRY CODES | |
// ========================================== | |
/** | |
* Countries data. | |
* This is the source that should be updated if you want to add/remove new country codes. | |
*/ | |
const countriesData = [ | |
["Afghanistan", "AF", "AFG"], |
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
diff --git a/node_modules/nativewind/dist/style-sheet/color-scheme.js b/node_modules/nativewind/dist/style-sheet/color-scheme.js | |
index c08e40b..0505525 100644 | |
--- a/node_modules/nativewind/dist/style-sheet/color-scheme.js | |
+++ b/node_modules/nativewind/dist/style-sheet/color-scheme.js | |
@@ -7,6 +7,16 @@ class ColorSchemeStore { | |
this.colorSchemeListeners = new Set(); | |
this.colorScheme = react_native_1.Appearance.getColorScheme() || "light"; | |
this.colorSchemeSystem = "system"; | |
+ react_native_1.Appearance.addChangeListener(({ colorScheme }) => { | |
+ if (this.colorSchemeSystem === "system") { |
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
/** | |
* Determines whether an error is a QuotaExceededError. | |
* | |
* Browsers love throwing slightly different variations of QuotaExceededError | |
* (this is especially true for old browsers/versions), so we need to check | |
* different fields and values to ensure we cover every edge-case. | |
* | |
* @param err - The error to check | |
* @return Is the error a QuotaExceededError? | |
*/ |
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
/** | |
* Fill localStorage to its maximum capacity. | |
* | |
* First, we find the highest order bit (the bit with the highest place value) | |
* that fits in localStorage by storing localStorage an increasingly big | |
* string of length 2, 4, 8, 16, etc. until it won't fill localStorage anymore. | |
* | |
* By working in iterations, starting with very long strings, and storing data | |
* in different items, we can keep a low memory profile and reduce the number of | |
* writes — making this process pretty fast. |
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
/** | |
* GlobalsDebugger | |
* | |
* Inspect the stack when a global variable is being set on the window object. | |
* Given a global variable name, it proxies the variable name in the window | |
* object adding some custom code that will be invoked whenever the variable | |
* is set. The custom code will log the current stack trace and halt the code | |
* execution to allow inspecting the stack and context in your browser DevTools. | |
* You can use the "globalsToInspect" query-parameter to set a comma-separated | |
* list of names of the variables you want to inspect. |
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
/** | |
* RuntimeGlobalsChecker | |
* | |
* You can use this utility to quickly check what variables have been added (or | |
* leaked) to the global window object at runtime (by JavaScript code). | |
* By running this code, the globals checker itself is attached as a singleton | |
* to the window object as "__runtimeGlobalsChecker__". | |
* You can check the runtime globals programmatically at any time by invoking | |
* "window.__runtimeGlobalsChecker__.getRuntimeGlobals()". | |
* |
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
// Deno CLI script to add reminders to Apple's Reminders app parsing the | |
// due date with natural language. | |
// Requires reminders-cli (https://github.com/keith/reminders-cli) to be | |
// installed in order to run. Uses reminders-cli instead of Applescript/JXA | |
// because reminders-cli is much faster. | |
// Uses chrono-node (https://github.com/wanasit/chrono) to parse the date (which | |
// in my opinion works better than reminders-cli natural lanaguage parser). | |
// | |
// Example usage: | |
// ``` |
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
<html> | |
<body> | |
<link | |
rel="stylesheet" | |
href="https://unpkg.com/[email protected]/build/pure-min.css" | |
integrity="sha384-Uu6IeWbM+gzNVXJcM9XV3SohHtmWE+3VGi496jvgX1jyvDTXfdK+rfZc8C1Aehk5" | |
crossorigin="anonymous" | |
id="purecss" | |
/> | |
<p>Hello world</p> |
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
// Just a Deno script that bumps an NPM dependency of the project | |
// in the current directory. | |
// Might be helpful if you need to automate the bumping of a | |
// dependency across multiple repos. | |
// It: | |
// - Makes sure you start from a clean state | |
// - Auto-detects if using yarn or npm | |
// - Creates, commits, and pushes the changes in a separate branch | |
import * as Colors from "https://deno.land/std/fmt/colors.ts"; | |
import yargs from "https://deno.land/x/yargs/deno.ts"; |
NewerOlder