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
@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 / FirebaseAuth.tsx
Created June 7, 2018 22:57
react components to handle firebase auth
import { app, User } from 'firebase/app'
import React from 'react'
interface AuthContext {
hasLoaded: boolean
user: User | null
claims?: any
logOut?: () => Promise<any>
logIn?: (email: string, password: string) => void
error?: string
@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 / index.js
Created March 18, 2017 22:30
firebase-functions express.js path fix
const app = require('express')();
// define your routes, etc ...
exports.route = functions.https.onRequest((req, res) => {
// https://some-firebase-app-id.cloudfunctions.net/route
// without trailing "/" will have req.path = null, req.url = null
// which won't match to your app.get('/', ...) route
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 / every-5-minutes.cron.yaml
Last active August 2, 2018 20:38 — forked from codyzu/every-5-minutes.cron.yaml
Kubernetes CronJob publishing to a PubSub topic
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: monthly-late-fee-rent
spec:
schedule: "0 6 1 * *"
jobTemplate:
spec:
template:
spec:
@cdock1029
cdock1029 / package.json
Created July 19, 2018 18:48 — forked from stefanjudis/package.json
Cached SQIP implementation on Netlify
{
"name": "sqip-cache-tryout",
"version": "1.0.0",
"description": "",
"main": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "stefan judis <stefanjudis@gmail.com>",
@cdock1029
cdock1029 / sensible-defaults.css
Created June 2, 2018 12:30 — forked from cesarandreu/sensible-defaults.css
Sensible css defaults taken from css-layout
div, span {
box-sizing: border-box;
position: relative;
display: flex;
flex-direction: column;
align-items: stretch;
flex-shrink: 0;
align-content: flex-start;