Skip to content

Instantly share code, notes, and snippets.

View aleury's full-sized avatar

Adam Eury aleury

View GitHub Profile
@aleury
aleury / 00_GraphQL_Subscriptions.md
Created December 4, 2018 23:20 — forked from tricoder42/00_GraphQL_Subscriptions.md
GraphQL Subscriptions with django-channels

GraphQL Subscription with django-channels

Django channels are official way for implementing async messaging in Django.

The primary caveat when working with GraphQL subscription is that we can't serialize message before broadcasting it to Group of subscribers. Each subscriber might use different GraphQL query so we don't know how to serialize instance in advance.

See related issue

@aleury
aleury / build.sh
Created December 4, 2018 10:05 — forked from bobbytables/build.sh
Protocol Buffer build script for multiple folders
#!/usr/bin/env bash
# This script is meant to build and compile every protocolbuffer for each
# service declared in this repository (as defined by sub-directories).
# It compiles using docker containers based on Namely's protoc image
# seen here: https://github.com/namely/docker-protoc
set -e
REPOPATH=${REPOPATH-/opt/protolangs}
CURRENT_BRANCH=${CIRCLE_BRANCH-"branch-not-available"}
@aleury
aleury / boto3_get-ssm-parameter.py
Created February 2, 2018 22:51 — forked from mda590/boto3_get-ssm-parameter.py
Get a Secure String parameter stored in the EC2 Systems Manager
def getParameter(param_name):
"""
This function reads a secure parameter from AWS' SSM service.
The request must be passed a valid parameter name, as well as
temporary credentials which can be used to access the parameter.
The parameter's value is returned.
"""
# Create the SSM Client
@aleury
aleury / keybase.md
Created January 1, 2018 21:19
keybase proof

Keybase proof

I hereby claim:

  • I am aleury on github.
  • I am adameury (https://keybase.io/adameury) on keybase.
  • I have a public key ASAW8Or4cawWNFUof7xQMrSh2zFxbZwCwLUhHFLzcmvJZQo

To claim this, I am signing this object:

@aleury
aleury / ngrxintro.md
Created October 4, 2016 22:21 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@aleury
aleury / index.html
Created May 26, 2016 09:53
react dropdown component
<div id="app">
<section class="dropdowns">
<div id="dd1"></div>
<div id="dd2"></div>
</section>
<section class="blocks">
<h4>Options</h4>
<div id="options"></div>
@aleury
aleury / task.yml
Created November 18, 2015 04:56 — forked from maxim/task.yml
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
@aleury
aleury / latency.markdown
Created October 23, 2015 15:36 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs