Skip to content

Instantly share code, notes, and snippets.

View KevinOrtman's full-sized avatar

Kevin Ortman KevinOrtman

View GitHub Profile
@miguelmota
miguelmota / example-app.spec
Last active March 15, 2021 14:25
Golang binary RPM spec
# https://fedoraproject.org/wiki/PackagingDrafts/Go
%global commit 63fe64c471e7d76be96a625350468dfc65c06c31
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: example-app
Version: 1.0.0
Release: 6%{?dist}
Summary: This application is an example for the golang binary RPM spec
License: ASL 2.0
URL: http://www.example-app.io
@lourd
lourd / streamSaga.test.js
Last active July 13, 2017 04:17
Example of a redux-saga saga function that uses an external emitter through an eventChannel, tested with redux-saga-test-plan
import { eventChannel } from 'redux-saga'
import { call, cps, take, fork, put, cancel, select } from 'redux-saga/effects'
function emitterChannel(emitter, eventType) {
return eventChannel(emit => {
emitter.on(eventType, emit)
return () => emitter.off(eventType, emit)
})
}
@lourd
lourd / firebaseChannel.test.js
Last active September 19, 2018 03:56
Example of making a channel in redux-saga with a firebase source and testing it with jest
import { eventChannel } from 'redux-saga'
function firebaseChannel(firebase, {
eventType = 'value',
returnSnapshot = false,
} = {}) {
return eventChannel(emit => {
const subscription = firebase.on(eventType, snapshot => {
emit(returnSnapshot ? { snapshot } : { value: snapshot.val() })
})