Skip to content

Instantly share code, notes, and snippets.

View cmmartin's full-sized avatar

Charlie Martin cmmartin

  • Founderpath
  • Brooklyn, NY
View GitHub Profile
@cmmartin
cmmartin / redis.js
Created December 2, 2017 19:13
Redis client for node.js that uses promises
/* @flow */
import redis from 'redis'
import bluebird from 'bluebird'
bluebird.promisifyAll(redis.RedisClient.prototype)
bluebird.promisifyAll(redis.Multi.prototype)
const client = redis.createClient(process.env.REDIS_URL)

Keybase proof

I hereby claim:

  • I am cmmartin on github.
  • I am charliemartin (https://keybase.io/charliemartin) on keybase.
  • I have a public key ASB0YIxZ0_Ci3kADAbuH-eofDcgSPM6jdGxDgXnMscHTywo

To claim this, I am signing this object:

@cmmartin
cmmartin / useGraphQL.js
Last active May 12, 2019 06:58
The simplest way to make a graphQL request in React
/**
* Usage:
*
* function Movie({ title = 'Inception' }) {
* const [data, loading, error] = useGraphQL('https://api.graph.cool/simple/v1/movies', `
* query getMovie($title: String!) {
* Movie(title: $title) {
* releaseDate
* actors {
* name
@cmmartin
cmmartin / what-do-i-restart.sh
Created May 1, 2022 18:35
Find what service is running the web server in bash
netstat -tulpen | grep 443