Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / dom3d.js
Last active May 20, 2024 09:12
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@jakobvase
jakobvase / Search.tsx
Last active January 21, 2023 19:34
Relay search component
import graphql from "babel-plugin-relay/macro";
import { Suspense, useState } from "react";
import {
PreloadedQuery,
usePaginationFragment,
usePreloadedQuery,
useQueryLoader,
} from "react-relay";
import { SearchQuery } from "./__generated__/SearchQuery.graphql";
import { Search_Results$key } from "./__generated__/Search_Results.graphql";
@pesterhazy
pesterhazy / building-sync-systems.md
Last active May 18, 2024 21:47
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@challapradyumna
challapradyumna / DGraph.arm64.Dockerfile
Created April 23, 2021 17:53
Build DGraph for ARM processor
ARG GOLANG=1.13.8-buster
FROM golang:${GOLANG} as builder
RUN apt-get update && apt-get install -qy build-essential software-properties-common gcc make sudo
ENV CGO_ENABLED=1 GOOS=linux GOARCH=arm64
RUN go get -u -v google.golang.org/grpc && \
git clone --depth 1 --branch v20.07.2 https://www.github.com/dgraph-io/dgraph/ && \
cd dgraph && \
make dgraph
@Offirmo
Offirmo / javascript_learning_resources.md
Last active May 8, 2024 07:47
[Resources for learning JavaScript] #JavaScript
@sibelius
sibelius / AutocompleteRelay.tsx
Last active March 23, 2024 10:13
@material-ui Autocomplete lab with react-window + infinite-loader for GraphQL/Relay connections
import React, { useRef, useState } from 'react';
import { Typography } from '@material-ui/core';
import TextField from '@material-ui/core/TextField';
import CircularProgress from '@material-ui/core/CircularProgress';
import Autocomplete, {
AutocompleteChangeDetails,
AutocompleteChangeReason,
AutocompleteProps
} from '@material-ui/lab/Autocomplete';
@chrissm79
chrissm79 / App.tsx
Last active December 29, 2019 03:46
Relay Snapshots
// create relay environment
import { RelaySnapshot } from './RelaySnapshot'
import { RecordSource } from './RecordSource'
import { Store } from './Store'
export const environment = new Environment({
network: Network.create(fetchQuery),
store: new Store(new RecordSource()),
})

The Challenge

Compare two (or more) tools that are trying to solve a similar set of problems, without discussing any of the following:

  • Community
  • Programming Language
  • Documentation/Examples/Demos/etc
  • Stars/Forks/Downloads/Issues/PRs/Stack Overflow Answers/etc
  • Age/Maturity of tool

A Redux Story

Developer: "Doo Doo Doo... Working on the new Redux rewrite. Gotta write some fetch actions..."

FETCH_USERS -> function fetchUsersAction() {...}
FETCH_PAGES -> function fetchPagesAction() {...}
FETCH_FRIENDS -> function fetchFriendsAction() {...}
FETCH_GROUPS -> function fetchGroupsAction() {...}
FETCH_EVENTS -> function fetchEventsAction() {...}
@ibraheem4
ibraheem4 / postgres-brew.md
Last active May 20, 2024 07:49 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update