Skip to content

Instantly share code, notes, and snippets.

@Inlustra
Inlustra / thoughts.md
Last active November 5, 2024 16:25
Implementation of DMNO

Dynamic Values in Vite Config

Currently, Vite's configuration supports static values, which may be an issue for our project as we don’t want to pass all backend service environment variables at build time.

Question:
Do dynamic values fail early at runtime?


Plugins

@Inlustra
Inlustra / keybase.md
Created June 24, 2022 23:02
keybase.md

Keybase proof

I hereby claim:

  • I am inlustra on github.
  • I am inlustra (https://keybase.io/inlustra) on keybase.
  • I have a public key ASBm9LdtOGFZ1ltKmuJ12dTvKD980-RtxKOX6LcbAoUVGQo

To claim this, I am signing this object:

@Inlustra
Inlustra / EXAMPLE_fa.js
Last active December 26, 2024 03:32
Next.js dynamic compatible react-icons generator
import type { IconBaseProps } from "@react-icons/all-files";
import dynamic from "next/dynamic";
import React, { ComponentType } from "react";
export interface IconPackProps extends IconBaseProps {
icon: string;
}
export const IconPack: React.FC<IconPackProps> = ({ icon, ...props }) => {
@Inlustra
Inlustra / .env
Last active May 27, 2021 11:26
Teedy / Sismics docs reprocess all files
BASE_URL=https://YOUR_INSTALLATION_OF_TEEDY
USERNAME=
PASSWORD=
@Inlustra
Inlustra / usage.tsx
Last active October 6, 2020 09:24
An example of managing the user context using hooks and context
export const MyComponent: React.FC = () => {
const { user, loading } = useUserContext();
return loading ? <h1>Loading...</h1> :
user ? <h1>Hi {user.firstName}</h1> :
<h1>Not Logged In</h1>
}
export const App: React.FC = () => {
return (
@Inlustra
Inlustra / FallbackImage.tsx
Last active August 5, 2020 19:14
WeServ Image Component for React Native - https://images.weserv.nl/docs/
import React, { useCallback, useState, forwardRef } from "react";
import { Image, ImageProps, ImageSourcePropType } from "react-native";
export interface Props extends Omit<ImageProps, "source"> {
fallback: ImageProps["source"];
source?: ImageSourcePropType;
}
export const FallbackImage = forwardRef<Image, Props>(
({ fallback, source, ...props }, ref) => {
@Inlustra
Inlustra / cookie-passthrough-link.tsx
Last active August 2, 2020 19:57
Passing cookies through when using Apollo and NextJS
@Inlustra
Inlustra / paddingGenerator.js
Last active April 17, 2019 13:26
Super stupid css generator for spacing helper
function gen(sizes) {
const a = Object.keys(sizes).map(key => `.p-a-${key} { padding: ${sizes[key]}px; }`)
const x = Object.keys(sizes).map(key => `.p-x-${key} { padding-left: ${sizes[key]}; padding-right: ${sizes[key]}px; }`)
const y = Object.keys(sizes).map(key => `.p-y-${key} { padding-top: ${sizes[key]}; padding-bottom: ${sizes[key]}px; }`)
const t = Object.keys(sizes).map(key => `.p-t-${key} { padding-top: ${sizes[key]}px; }`)
const b = Object.keys(sizes).map(key => `.p-b-${key} { padding-bottom: ${sizes[key]}px; }`)
const l = Object.keys(sizes).map(key => `.p-l-${key} { padding-left: ${sizes[key]}px; }`)
const r = Object.keys(sizes).map(key => `.p-r-${key} { padding-right: ${sizes[key]}px; }`)
return a.concat(x, y, t, b, l, r)
@Inlustra
Inlustra / userChrome.css
Last active February 8, 2019 15:14
Hide Firefox tabs with spacing for Mac window buttons (v64)
#TabsToolbar-customization-target {
visibility: collapse;
}
toolbar#TabsToolbar {
min-height: 0 !important;
}
#nav-bar {
margin-left: 80px;
@Inlustra
Inlustra / .hyper.js
Last active April 9, 2018 15:51
Antibody + Hyper
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
summon: {
hideDock: false,
hideOnBlur: false,