Skip to content

Instantly share code, notes, and snippets.

Open to new opportunities

Glenn 'devalias' Grant 0xdevalias

Open to new opportunities
View GitHub Profile
goran-peoski-work / lazy.ts
Last active Jul 7, 2021
Dynamic import of omponent
View lazy.ts
import React, { ComponentType, LazyExoticComponent } from "react";
type Transformer = <T>(name: keyof T) => (module: T) => { default: T[keyof T] };
const transformer: Transformer = (
(name) => (module) => ({ default: module[name] })
djs55 /
Last active Jul 25, 2020
Development builds containing the Docker Desktop + Mutagen integration

This is a list of Docker Desktop for Mac development builds which contain mutagen. These are based on Edge, but may contain unexpected bugs. They should be used for testing the Mutagen feature rather than for production work.

2020-07-14: development snapshot:

  • Exclude files from a mutagen sync based on the .dockerignore file.
  • Flush around docker exec as well as docker run for more reliable scripting.
  • Fix a bug which could result in duplicates in the list of synchronised directories.
  • Allow the sync to be bypassed by using :consistent or :cached. In particular this means if you want the previous :delegated behaviour before mutagen, switch to :cached. This
View Keybase
### Keybase proof
I hereby claim:
* I am moloch-- on github.
* I am moloch ( on keybase.
* I have a public key whose fingerprint is 0E59 543B A7BC 269F 3AAE 707E B705 0578 9B38 EEA6
To claim this, I am signing this object:
zachboyd / AWSSubscriptionClient.ts
Last active Jul 28, 2021
Appsync Subscription support for subscriptions-transport-ws
View AWSSubscriptionClient.ts
import { uniqBy } from 'lodash';
import { ClientOptions, SubscriptionClient } from 'subscriptions-transport-ws';
export class AWSSubscriptionClient extends SubscriptionClient {
url: string,
options?: ClientOptions,
webSocketImpl?: any,
webSocketProtocols?: string | string[]
) {
jacobmix /
Last active Apr 21, 2020
SyncLounge Docker guide

Here's how you set up on SyncLounge with Docker (Now with Markdown):
First make sure you got the Docker Hub in your registry:

Download the latest SyncLounge image:

Launch the image, and go to advanced settings:
Create Container

joecot /
Last active Apr 4, 2021
Synclounge Selfhosted Without Docker

Self Hosted SyncLounge (without Docker)

This is a quick howto for self-hosting SyncLounge, a useful tool for hosting watch parties for your Plex server.

If you just want to host a plex party, you can use the public server. If you want to use Docker instead of mucking about with Node, the SyncLounge readme describes it. This is for running the NodeJS yourself.

You don't need programming experience to set SyncLounge up, but without a passable experience configuring linux, you're probably better off using instead.

Server Pre-Reqs

slikts /
Last active Sep 23, 2021
Advanced memoization and effects in React

Advanced memoization and effects in React

Memoization is a somewhat fraught topic in the React world, meaning that it's easy to go wrong with it, for example, by [making memo() do nothing][memo-pitfall] by passing in children to a component. The general advice is to avoid memoization until the profiler tells you to optimize, but not all use cases are general, and even in the general use case you can find tricky nuances.

Discussing this topic requires some groundwork about the technical terms, and I'm placing these in once place so that it's easy to skim and skip over:

  • Memoization means caching the output based on the input; in the case of functions, it means caching the return value based on the arguments.
  • Values and references are unfortunately overloaded terms that can refer to the low-level implementation details of assignments in a language like C++, for example, or to memory
slikts /
Last active Sep 20, 2021
Why using the `children` prop makes `React.memo()` not work

Why using the children prop makes React.memo() not work

I've recently ran into a pitfall of [React.memo()][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo() (at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:

const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
// Will re-render every time; the memoization does nothing
jfcherng /
Last active Sep 5, 2021
Sublime Text 4 changelog just because it's not on the official website yet.
pftg / Yarn Upgrade Indirect
Last active Feb 4, 2021
Update indirect dependencies in yarn.lock. `ruby rejuvenation.rb & yarn install`
View Yarn Upgrade Indirect
$> curl "" | ruby


$> ruby rejuvenation.rb
$> yarn install