Skip to content

Instantly share code, notes, and snippets.

@dangovorenefekt
dangovorenefekt / blockmetatwitter.md
Last active August 9, 2024 05:27
Block Meta and Twitter (nginx)
@nivethan-me
nivethan-me / README.md
Last active July 13, 2024 06:05
Setup a Next.js 13 project with Eslint + Prettier with automatic tailwind class sorting
import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node";
export const mergeMeta = (
overrideFn: V2_MetaFunction,
appendFn?: V2_MetaFunction,
): V2_MetaFunction => {
return arg => {
// get meta from parent routes
let mergedMeta = arg.matches.reduce((acc, match) => {
return acc.concat(match.meta || []);
// TODO: make `pages` optional and measure the div when unspecified, this will
// allow more normal document flow and make it easier to do both mobile and
// desktop.
import {
createContext,
useCallback,
useContext,
useEffect,
useMemo,
useRef,
@chanan
chanan / auth.server.js
Created December 21, 2021 21:55
Cognito authentication method for Remix
import { redirect, createCookie } from "remix";
const sessionSecret = process.env.SESSION_SECRET;
const cognitoDomain = process.env.COGNITO_DOMAIN;
const clientId = process.env.CLIENT_ID;
if (!sessionSecret) {
throw new Error("SESSION_SECRET must be set");
}
if (!cognitoDomain) {
throw new Error("COGNITO_DOMAIN must be set");
@arter97
arter97 / firewall.sh
Last active September 7, 2024 07:01
ipset firewall for crontab
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
exec > /dev/kmsg 2>&1
TMP=/tmp/ipsum.txt
until wget --spider https://raw.githubusercontent.com/stamparm/ipsum/master/ipsum.txt > /dev/null 2>&1; do
echo "Waiting for GitHub to be accessible"
@wilsonpage
wilsonpage / swr.ts
Last active September 6, 2024 07:46
An implementation of stale-while-revalidate for Cloudflare Workers
export const CACHE_STALE_AT_HEADER = 'x-edge-cache-stale-at';
export const CACHE_STATUS_HEADER = 'x-edge-cache-status';
export const CACHE_CONTROL_HEADER = 'Cache-Control';
export const CLIENT_CACHE_CONTROL_HEADER = 'x-client-cache-control';
export const ORIGIN_CACHE_CONTROL_HEADER = 'x-edge-origin-cache-control';
enum CacheStatus {
HIT = 'HIT',
MISS = 'MISS',
REVALIDATING = 'REVALIDATING',
@jigzstar
jigzstar / caprover.odoo
Last active March 22, 2022 18:47
Caprover odoo one click setup from @abedev31
{
"captainVersion": "2",
"documentation": "https://github.com/caprover/one-click-apps",
"dockerCompose": {
"version": "3.3",
"services": {
"$$cap_appname-db": {
"image": "postgres:$$cap_postgres_version",
"notExposeAsWebApp": "true",
"volumes": [

Libraries and Tools for React

If you're developing an application based on React it can be helpful if you don't need to develop all the basic UI components yourself. Here you can find a list with various components, component libraries and complete design systems developed with and for React.

As the list got longer and longer I thought it would be better to have a "real" site for it.

👉 Please find the (new) list here: https://react-libs.nilshartmann.net/

@louim
louim / uploads.yml
Last active December 23, 2022 14:20
Drop-in playbook for Trellis to push and pull uploads from the server to your local machine.
---
- name: Sync uploads between environments
hosts: web
remote_user: "{{ web_user }}"
vars:
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
tasks: