Skip to content

Instantly share code, notes, and snippets.

@Igloczek
Igloczek / inline.ts
Last active January 9, 2026 07:51
Astro middleware for inlining critical JS to reduce requests chains
// Not sure whether it's genius or stupid, but it definitely works.
// The goal is to reduce chaining critical requests.
// By default in most cases Astro do this: html -> small chunk -> big chunk(s), which is kinda like Require.js, where you need to download file, to know what file you want to download.
// Code below takes this small chunk and inlines it into html, so we have at least one client-side request to make less: html -> big chunk(s).
// Additionally we can add "modulepreload" to start fetching those files faster (not sure where in this particular case it makes any sense, but was easy to add, so I did it).
// For sure this code isn't optimal, I just quickly hacked it just to have PoC, but I belive it won't hurt server-side performance that much.
// If you know some better way to do it, that doesn't require digging through HTML and replacing strings, please let me know.
import fs from "node:fs"
import path from "node:path"
@maxpert
maxpert / .dockerignore
Last active May 6, 2025 15:02
Marmot + PocketBase + Fly.io
/.git
@dkun7944
dkun7944 / CDView.swift
Last active September 28, 2025 06:34
SwiftUI + Swift.Shader CD
//
// CDView.swift
// CD
//
// Created by Daniel Kuntz on 7/3/23.
//
import SwiftUI
struct ShapeWithHole: Shape {
@nandorojo
nandorojo / widget.md
Last active June 26, 2025 14:45
How to create an iOS Widget with React Native (Expo / EAS)

First, copy the config plugin from this repo: https://github.com/gaishimo/eas-widget-example

You can reference my PRs there too (which, at the time of writing, aren't merged).

After adding the config plugin (see app.json) with your dev team ID, as well as a bundle ID, you can edit the widget folder to edit your code. Then npx expo run:ios (or npx expo run:android).

Workflow

After npx expo run:ios, open the ios folder, and open the file that ends in .xcworkspace in XCode. Make sure you have the latest macOS and XCode versions. If you don't, everything will break.

Quick start

Tauri is shipped with state management function/feature by default.

Basic usage is quite simple: a variable of State type can be accessed on the tauri commands which you have defined; in other words, "with tauri commands, they'll magically inject state for you," so that once a variable is managed you can inject them directly as additional input when defining the command.

Example Implementation

@hirbod
hirbod / expoAnimatedWebPforIOSandAndroid.md
Last active January 10, 2024 09:11
expo-config-plugin: animated webP support for Expo SDK44+ and Custom Dev Client (with FastImage) support

I recommend to not use this anymore. Switch over to expo-image

If anybody needs animated webP support with Expo (Custom Dev Client) for the native <Image /> and <FastImage /> (read comments):

Android

// create a file like plugins/withAnimatedWebPSupport.js -> this is for the native <Image />

const {
@arnars
arnars / Gatsby v2 using Internet Explorer.md
Last active February 15, 2021 08:01
Tips for making Gatsby v2 working with IE / Internet Explorer

Making Gatsby work with Internet Explorer 10 and 11

I created this gist in order to help myself and others keep track of tips and tricks in order to make Gatsby v2 play nicely with Internet Explorer 10 and 11.

This is experience based. Please share your experiences when you have a solution to a problem.

External compilation of modules

If you suspect that an es6-based module is breaking your app, then try to add gatsby-plugin-compile-es6-packages and include the package as one of the modules.

@kevinelliott
kevinelliott / 1-macOS-10.14-mojave-setup.md
Last active December 9, 2025 14:04
macOS 10.14 Mojave Mostly-Automated Setup

To support my open-source work, consider adding me on Patreon.

macOS 10.14 Mojave Mostly-Automated Setup

An easy to refer to document for regularly setting up macOS 10.14 Mojave.

Controversy

The topic of recipe-based frequent fresh reinstalls of macOS is a controversial issue. Some people are against reinstalling macOS, citing that they have never had an issue with Apple provided upgrade installs.

@nickdandakis
nickdandakis / package.json
Created October 14, 2017 18:21
Next.js + AWS Elastic Beanstalk + AWS EC2 Container Service + Docker package.json
{
"name": "this-web-scale",
"version": "x.x.x",
"scripts": {
"dev": "node server.js",
"build": "NODE_ENV=production next build",
"start": "NODE_ENV=production node server.js",
"dockerize": "npm run build:docker && npm run tag:docker && npm run push:docker && npm run tag-latest:docker && npm run push-latest:docker",
"deploy": "npm run deploy:staging",
"deploy:staging": "eb use token-staging && eb deploy --label v$npm_package_version --verbose",