Skip to content

Instantly share code, notes, and snippets.

View dmichael's full-sized avatar

David Michael dmichael

View GitHub Profile
dmichael / httpclient.go
Last active October 18, 2023 20:07
Light wrapper for the Go http client adding (essential) timeouts for both connect and readwrite.
package httpclient
import (
type Config struct {
ConnectTimeout time.Duration

Redux WebSocket Middleware: Example

This Gist provides some code examples of how to implement WebSocket stream handling using a Redux middleware. Please be aware that this is only provided as an example and that critical things like exception handling have not been implemented.

A more complete version has been packaged, tested, and is available on GitHub as redux-websocket. This library has also been published to npm at @giantmachines/redux-websocket.


This module represents the foundation of the middleware and implements the ideas presented above. The exported function is used during the creation of the Redux store (see the following snippet).

"claims": [
"url": "",
"timestamp": 1579006108,
"timestamp": 1579006110,
"type": "ACCOUNT",
"claims": [
"url": "",
"timestamp": 1579211383,
"timestamp": 1579211648,
"type": "ACCOUNT",
dmichael /
Created December 6, 2019 20:16
Celo Stake Off

CELO_VALIDATOR_GROUP_ADDRESS=c5636b98fd6ddff3a7bb239e9729d75338e9a61f CELO_VALIDATOR_ADDRESS=dbc52f9e934145e2e3172aead59303328bbad2d1

Keybase proof

I hereby claim:

  • I am dmichael on github.
  • I am dmichael ( on keybase.
  • I have a public key ASBeTozA--Pqbk2tqs8b_OOmQu675NOHNMRPoHSTtO9EDgo

To claim this, I am signing this object:

type: sender
symbol: XZC
to: aKNsk9tYEjwL8hUpTfD6rF5WJFPgaM1eG5
amount: 7.5
every: 5 days
# Bitcoin+Lightning node running on mainnet
bitcoin: {}
lnd_bitcoin: {}
dmichael / gist:1362424
Created November 13, 2011 18:11
Sigmoid Gradient
function g = sigmoid(z)
g = sigmoid = 1.0 ./ (1.0 + exp(-z));
function g = sigmoidGradient(z)
g = sigmoid(z) .* (1 - sigmoid(z));