Skip to content

Instantly share code, notes, and snippets.

View cdock1029's full-sized avatar
🏠
Working from home

Conor Dockry cdock1029

🏠
Working from home
View GitHub Profile
import React from 'react'
import { AnyValue } from 'react-values'
interface SharedProps<T> {
// defaultValue?: T
// value?: T
// onChange?(value: T): void
children(params: {
value: T
set(value: T): void
@cdock1029
cdock1029 / Counter.jsx
Last active September 21, 2018 21:33
simple componentFromStream
const Counter = componentFromStream(props$ => {
const { handler: increment, stream: inc$ } = createEventHandler()
const params$ = props$.pipe(
switchMap(props =>
inc$
.pipe(
mapTo(1),
startWith(props.initialValue || 0),
scan((acc, inc) => acc + inc)
@cdock1029
cdock1029 / phx_sqlite_fly_launch.md
Last active March 30, 2023 01:20 — forked from mcrumm/phx_sqlite_fly_launch.md
Phoenix + SQLite Deployment tips + Tailscale private app
$ fly launch --no-deploy --force-machines

The fly launch command generates a Dockerfile, a fly.toml configuration and some release files into your Phoenix app. It will even set SECRET_KEY_BASE for you.

$ fly volumes create myapp_data --size 1
@cdock1029
cdock1029 / Demo.razor
Created March 5, 2025 04:25
Converter accessing previous data
@page "/demo"
<h2>Items Diff</h2>
<div class="flex items-end">
@foreach ((int idx, int n) in _nums.Index())
{
<div class="mx-4 w-20">
@{
int diff = @Diff(_nums, idx);