Skip to content

Instantly share code, notes, and snippets.

cryptosi: Hi guys, looking to convince my company to use Remix but need some compelling arguments. This new project is definitely a good use case so I want to be able to articulate why we should use Remix. I've been doing my own research but wanted to reach out here to see if anyone had resources they might use for me to read and compile a list of reasons to use remix.

From purpler:

  • helped me avoid needing a graphql layer between my frontend and prisma

From Julienng:

  • simpler model than next : no isr, & all : it's easier to explain to new developer
  • simpler form than anything in the react world when you don't need anything fancy, and you can still do fancy stuff when needed
  • auto reload of loader when an action is fired : bye bye refreshListeners on parents for us and reloadPage() callback 😅
@ngbrown
ngbrown / LineDelimitedProgram.cs
Last active September 3, 2021 17:28
Line delimited json de-serializing with .NET 5
using System;
using System.Buffers;
using System.Collections.Generic;
using System.IO;
using System.IO.Pipelines;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
@ngbrown
ngbrown / lint-eol-history.py
Created May 8, 2021 19:59
Filter for git-filter-repo to convert all text files to LF line endings, for example after a Mercurial conversion
#!/usr/bin/env python3
"""
This is a simple program that will run a linting program on all non-binary
files in history. It also rewrites commit hashes in commit messages to
refer to the new commits with the rewritten files.
See https://github.com/newren/git-filter-repo/issues/45
and https://github.com/newren/git-filter-repo/blob/main/contrib/filter-repo-demos/lint-history
"""
@ngbrown
ngbrown / Generate-SyncCerts.ps1
Created April 27, 2021 23:16
Download root certs for offline computer
certutil -syncwithwu -f -f .\certs
$certFiles = Get-ChildItem "$PSScriptRoot\certs\*.crt"
$certCommands = $certFiles | %{'certutil -addstore root "%~dp0certs\' + $_.Name + '"'}
extrac32 /Y .\certs\authrootstl.cab .\certs\authroot.stl
extrac32 /Y .\certs\disallowedcertstl.cab .\certs\disallowedcert.stl
extrac32 /Y .\certs\pinrulesstl.cab .\certs\pinrules.stl
$outputCmdPath = "$PSScriptRoot\update-certs.cmd"
import {useEffect, useRef, useState} from 'react';
import {debounce} from 'lodash';
export function useDebouncedValue<V>(value: V, wait: number) {
const [debouncedValue, setDebouncedValue] = useState(value);
const debounceRef = useRef<typeof setDebouncedValue>();
useEffect(() => {
const debounceFn = debounce(setDebouncedValue, wait);
debounceRef.current = debounceFn;
@ngbrown
ngbrown / NHibernateMicrosoftLoggerFactory.cs
Last active August 14, 2020 21:06
NHibernate to MicrosoftLogger Factory
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using NHibernate;
namespace App.Infrastructure
{
public class NHibernateMicrosoftLoggerFactory : INHibernateLoggerFactory
{
private readonly Microsoft.Extensions.Logging.ILoggerFactory loggerFactory;
@ngbrown
ngbrown / calendar.css
Created August 3, 2020 04:54 — forked from AndyCross/calendar.css
How the Calendar Visual might look in a few files
.day {
fill: #fff;
stroke: #ccc;
}
.month {
fill: none;
stroke-width: 2px;
}
@ngbrown
ngbrown / BlurImg.tsx
Last active December 11, 2023 08:56 — forked from WorldMaker/use-blurhash.ts
useBlurhash hook
import React, { useState, useCallback } from "react";
import { useBlurhash } from "./use-blurhash";
import { useInView } from "react-intersection-observer";
type Props = React.DetailedHTMLProps<
React.ImgHTMLAttributes<HTMLImageElement>,
HTMLImageElement
> & { blurhash?: string | null };
// Uses browser-native `loading="lazy"` to lazy load images
@ngbrown
ngbrown / Program.cs
Last active April 3, 2020 03:32 — forked from DanielSWolf/Program.cs
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@ngbrown
ngbrown / AuthProvider.tsx
Last active June 18, 2021 09:24
useAuth React authentication with oidc-client
import React, {
createContext,
useReducer,
useEffect,
useState,
useContext,
} from 'react';
import * as Oidc from 'oidc-client';
// Inspired by https://github.com/Swizec/useAuth