This file contains hidden or 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
| function rx(x, y, env) { | |
| function isNumber(str) { | |
| if (typeof str !== "string") return false; // Must be a string | |
| if (str.trim() === "") return false; // Empty string isn't a number | |
| return !isNaN(str) && isFinite(Number(str)); | |
| } | |
| x = l(x) | |
| .v.map((t) => String.fromCharCode(t.v)) | |
| .join(""); | |
| y = l(y) |
This file contains hidden or 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
| // Function to close any open code blocks | |
| function closeCodeBlocks() { | |
| const closeButtons = document.querySelectorAll('button'); | |
| closeButtons.forEach((button) => { | |
| const svgPath = button.querySelector('svg > path'); | |
| if (svgPath && svgPath.getAttribute('d').includes('M205.66')) { | |
| // This path corresponds to the close icon (adjust if necessary) | |
| button.click(); | |
| } | |
| }); |
This file contains hidden or 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
| import { useState, useEffect } from 'react'; | |
| const subscribers = new Map<string, Set<React.Dispatch<any>>>(); | |
| function useLocalStorage<T>(key: string, initialValue: T) { | |
| // State to store our value | |
| const [storedValue, setStoredValue] = useState<T>(() => { | |
| try { | |
| const item = window.localStorage.getItem(key); | |
| return item ? (JSON.parse(item) as T) : initialValue; |
This file contains hidden or 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
| class ReactiveLocalStorage { | |
| constructor() { | |
| this.listeners = {}; | |
| } | |
| setItem(key, value) { | |
| localStorage.setItem(key, value); | |
| this.notify(key, value); | |
| } |
This file contains hidden or 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
| #!/bin/bash | |
| find . -name "package.json" -type f | while read -r file; do | |
| # Backup the original file | |
| cp "$file" "${file}.bak" | |
| # Process dependencies and devDependencies | |
| for key in dependencies devDependencies; do | |
| jq --arg key "$key" ' | |
| if has($key) then |
This file contains hidden or 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
| (function(){ | |
| const w = 1920, h = 1080; | |
| // Function to make elements non-responsive | |
| function makeNonResponsive(element) { | |
| const style = window.getComputedStyle(element); | |
| const width = style.getPropertyValue('width'); | |
| const height = style.getPropertyValue('height'); | |
| const position = style.getPropertyValue('position'); | |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "os" | |
| "os/exec" | |
| "os/signal" | |
| "strconv" | |
| "strings" |
This file contains hidden or 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
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| ) |
This file contains hidden or 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
| FROM node:20.11.1-bookworm-slim | |
| ENV NODE_ENV=development | |
| WORKDIR /app | |
| RUN apt update | |
| RUN apt install -y build-essential | |
| RUN apt install -y vim wget lynx curl mariadb-client git bash | |
| RUN npm i -g ts-node | |
| RUN npm i -g jest |
This file contains hidden or 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
| (defun string-to-list (string) | |
| (mapcar #'princ-to-string (coerce string 'list))) | |
| ;; (string-to-list "123🚘🚃🚅456") | |
| ;; > ("1" "2" "3" "🚘" "🚃" "🚅" "4" "5" "6") | |
| ;; and | |
| (defun list-to-string (list) | |
| (let ((result "")) |