Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
bryanjswift / .rtorrent.rc
Created December 28, 2011 02:42
rtorrent configuration file with description
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 1
max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
@bryanjswift
bryanjswift / UAgentInfo.java
Created March 1, 2010 09:43
User Agent detection in Java
/* *******************************************
// LICENSE INFORMATION
// The code, "Detecting Smartphones Using PHP"
// by Anthony Hand, is licensed under a Creative Commons
// Attribution 3.0 United States License.
//
// Updated 01 March 2010 by Bryan J Swift
// - Remove un-needed if statements instead just returning the boolean
// inside the if clause
//

Minimal reproduction for [chakra-ui 7459][issue]

This minimal reproduction demonstrates a TypeScript compilation error for a simple component as well as a slightly more complex component when using @chakra-ui packages.

error TS2590: Expression produces a union type that is too complex to represent.
@bryanjswift
bryanjswift / abbreviated-unbound.conf
Last active September 19, 2022 05:02
Unbound (http://unbound.net/) configuration for local network device testing.
# The server clause sets the main parameters.
server:
# Allow network connections outside of localhost
interface: 0.0.0.0
# Don't automatically run in the background because I want to be able to kill it without hunting a pid
do-daemonize: no
# TODO: Change this to your network range, like `192.168.0.0/16 allow`
access-control: 10.0.0.0/16 allow
# TODO: Change this to your username, or whatever user you want to run/own the `unbound` process
username: "bryanjswift"
@bryanjswift
bryanjswift / machine.js
Last active June 18, 2021 15:51
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@bryanjswift
bryanjswift / machine.js
Last active June 18, 2021 15:51
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@bryanjswift
bryanjswift / machine.js
Last active March 12, 2020 19:28
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
const ComponentStateMachine = Machine({
id: 'component:record-screen',
initial: 'ssr',
states: {
ssr: {
on: {
MOUNT: {
target: 'loading',
},
},
@bryanjswift
bryanjswift / machine.js
Last active November 9, 2019 01:45
Generated by XState Viz: https://xstate.js.org/viz
/**
* For a given `state` from `CompositeMachine` should the video indicated by
* `state.context.videoSrc` be in a playback state or a paused state.
* @param state node from the `CompositeMachine`.
* @returns `false` (indicating a playing state) or `true` (indicating a paused
* state). `null` or `undefined` state nodes are `true`.
*/
function isVideoPaused(state) {
if (state === null || state === undefined) {
return true;
@bryanjswift
bryanjswift / machine.js
Last active October 25, 2019 18:24
Generated by XState Viz: https://xstate.js.org/viz
//----------------------------------------
const findingDevice = {
initial: 'findingDevice',
states: {
/* BASE STATES */
foundDevice: {
type: 'final',
},