Skip to content

Instantly share code, notes, and snippets.

View esmevane's full-sized avatar

Joseph McCormick esmevane

View GitHub Profile
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active May 16, 2024 02:05
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@staltz
staltz / introrx.md
Last active May 20, 2024 14:59
The introduction to Reactive Programming you've been missing
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@jaredhoyt
jaredhoyt / pre-push
Last active December 24, 2015 22:49
git pre-push hook to prevent force push to master
#!/usr/bin/env ruby
# This script has been slightly adapted from:
# http://blog.bigbinary.com/2013/09/19/do-not-allow-force-pusht-to-master.html
class PrePushHandler
def handle
reject if force_pushing? && pushing_to_master?
end
weave∙partition≡id : ∀ {A} {m n m+n : ℕ} {mn-proof : m + n ≅ m+n}
fn (vec : Vec A (m + n)) →
weave (partition {A} {m} {n} fn vec) ≅ vec
weave∙partition≡id {A} {0} fn [] = refl
weave∙partition≡id {A} {suc m} {0} fn (x ∷ xs) =
cong (_∷_ x) (weave∙partition≡id {A} {m} {_} {_} {+0 m} fn xs)
weave∙partition≡id {A} {0} {suc n} fn (x ∷ xs) =
cong (_∷_ x) (weave∙partition≡id {A} {0} {_} {_} {refl} fn xs)
weave∙partition≡id {A} {suc m} {suc n} fn (x ∷ xs) with fn x
... | true = cong (_∷_ x) (weave∙partition≡id {A} {m} {_} {_} {refl} fn xs)
@stephenprater
stephenprater / diffconflicts.sh
Created June 4, 2013 14:25
vim diff twopane
#!/bin/bash
# Instead of editing a file with <<<< ==== >>> conflict markers, this opens
# each "side" of the conflict markers in a two-way vimdiff window.
#
# Layout:
#
# Tab1 is a two-way diff of the conflicts.
# +--------------------------------+
# | LCONFL | RCONFL |
# +--------------------------------+
@quiver
quiver / README.md
Last active April 3, 2024 15:47
Who says PostgreSQL can't Pub/Sub like Redis?

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.

Publish

publish message to foo channel from user nickname.

$ python pub.py foo nickname
PUBLISH to channel #foo
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@plentz
plentz / gist:863523
Created March 10, 2011 03:20
easy way to get a ruby segmentation fault
~/Projects/opensource $ rails -v
ruby Rails 3.0.5
~/Projects/opensource $ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
~/Projects/opensource $ rails new foo
create
create README
...
create vendor/plugins/.gitkeep
~/Projects/opensource $ cd foo/