Skip to content

Instantly share code, notes, and snippets.


Jake Teton-Landis justjake

View GitHub Profile
mogelbrod / portal.js
Last active May 22, 2020
Non-bubbling React Portals
View portal.js
import PropTypes from 'prop-types'
import React from 'react'
import ReactDOM from 'react-dom'
function portalContainer() {
return document.getElementById('portal-container')
// Taken from
bvaughn / example.jsx
Last active Aug 1, 2022
Advanced example for manually managing subscriptions in an async-safe way using hooks
View example.jsx
import React, { useMemo } from "react";
import useSubscription from "./useSubscription";
// In this example, "source" is an event dispatcher (e.g. an HTMLInputElement)
// but it could be anything that emits an event and has a readable current value.
function Example({ source }) {
// In order to avoid removing and re-adding subscriptions each time this hook is called,
// the parameters passed to this hook should be memoized.
const subscription = useMemo(
() => ({
View rtorrent
# $FreeBSD$
# Runs as unprivileged user "rtorrent"
# Lives in "tmux" (like "screen") because rtorrent can't daemonize itself
# To access rtorrent client that's in the tmux: su - rtorrent && tmux attach
# To detach the tmux and leave rtorrent running: Ctrl-B then D
# nice'd default +10 step to make it go easy on the machine
# Don't forget to put rtorrent_enable="YES" in your /etc/rc.conf
jewelsea /
Last active May 24, 2020 — forked from teyc/
Animates transitions involved when relaying out nodes in a FlowPane
import javafx.animation.Transition;
import javafx.beans.value.*;
import javafx.collections.*;
import javafx.event.*;
import javafx.scene.Node;
import javafx.scene.transform.Translate;
import javafx.util.Duration;
import java.util.*;