Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Conor Dockry cdock1029

🏠
Working from home
View GitHub Profile
View gist:78b09335793a8486339eb5292ba9f5b2
@cdock1029
cdock1029 / Counter.jsx
Last active Sep 21, 2018
simple componentFromStream
View Counter.jsx
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)
View SharedValue.tsx
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 Aug 2, 2018 — forked from codyzu/every-5-minutes.cron.yaml
Kubernetes CronJob publishing to a PubSub topic
View every-5-minutes.cron.yaml
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 Jul 19, 2018 — forked from stefanjudis/package.json
Cached SQIP implementation on Netlify
View package.json
{
"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 / FirebaseAuth.tsx
Created Jun 7, 2018
react components to handle firebase auth
View FirebaseAuth.tsx
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 / sensible-defaults.css
Created Jun 2, 2018 — forked from cesarandreu/sensible-defaults.css
Sensible css defaults taken from css-layout
View sensible-defaults.css
div, span {
box-sizing: border-box;
position: relative;
display: flex;
flex-direction: column;
align-items: stretch;
flex-shrink: 0;
align-content: flex-start;
@cdock1029
cdock1029 / preact.config.js
Last active Oct 21, 2017
Example using styled-jsx with preact-cli default template
View preact.config.js
export default (config, env, helpers) => {
config.node = {process: 'mock'}
const {rule} = helpers.getLoadersByName(config, 'babel-loader')[0]
rule.options.plugins.splice(3, 0, 'styled-jsx/babel')
rule.options.plugins.splice(5, 0, 'styled-jsx/babel')
// console.log(JSON.stringify(rule.options.plugins, null, 2))
}
View keybase.md

Keybase proof

I hereby claim:

  • I am cdock1029 on github.
  • I am cdock (https://keybase.io/cdock) on keybase.
  • I have a public key ASAAVCp4n9wyQWhCUU2jLaATS2ZH_MNei7XxSgVom_X8Qwo

To claim this, I am signing this object: