Skip to content

Instantly share code, notes, and snippets.

View loganpowell's full-sized avatar

Logan Powell loganpowell

  • Metro DC
View GitHub Profile
@loganpowell
loganpowell / react-transition-children-demo.jsx
Created January 17, 2018 16:34
Add transition animations to a board of cards, animating cards as they are added to and removed from the board.
// from: https://dev.to/underdogio/adding-animations-to-your-react-app-with-react-transition-group
import './styles.css'
import React from 'react'
import Transition from 'react-transition-group/Transition'
import TransitionGroup from 'react-transition-group/TransitionGroup'
import {render} from 'react-dom'
function Card ({children, onRemove}) {
return (
@loganpowell
loganpowell / medium-rss.js
Last active January 17, 2018 17:43
Get Medium.com Posts (RSS)
// from: https://medium.jasonmdesign.com/display-medium-articles-on-your-site-d772b3b05779
// Resources:
// https://codepen.io/loganpowell/pen/ppxYVz
// https://help.medium.com/hc/en-us/articles/214874118-RSS-feeds
$(function () {
var $content = $('#jsonContent');
var data = {
rss_url: 'https://medium.jasonmdesign.com/feed'
};
@loganpowell
loganpowell / NavigationPrompt.jsx
Last active January 24, 2018 23:08 — forked from bummzack/NavigationPrompt.jsx
A replacement component for the react-router `Prompt`.
// from: https://github.com/ReactTraining/react-router/issues/4635#issuecomment-297828995
import React from 'react';
import {withRouter} from 'react-router-dom';
import PropTypes from 'prop-types';
/**
* A replacement component for the react-router `Prompt`.
* Allows for more flexible dialogs.
*
@loganpowell
loganpowell / gist:9683858b9bb6b4eee777c62b12fd9b0e
Created January 25, 2018 15:46 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@loganpowell
loganpowell / destructuring.js
Created January 26, 2018 16:37 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@loganpowell
loganpowell / apollo-link-state-single-values.md
Created February 1, 2018 21:12
Apollo Link State: how to manage single values in the store
@loganpowell
loganpowell / Event-stream based GraphQL subscriptions.md
Created February 3, 2018 05:07 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
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.

@loganpowell
loganpowell / UCC_design_introduction.md
Created February 13, 2018 20:43 — forked from xareelee/UCC_design_introduction.md
A better async/reactive function design in JS (or any other languages) — the Universal Currying Callback (UCC) Design

A better async/reactive function design in JS (or any other languages) — the Universal Currying Callback (UCC) Design

For the principle "Don't call us, we'll call you", the modern function design uses callbacks, Promise, or monad/stream-based techniques (e.g. Rx) to let you subscribe the async results.

The following is a usual JS function implementation using the callback for async:

function register(username, password, email, callback) {
 // processing async work
(ns sunil.curry)
(defn partial+
"Takes a function f and fewer than the normal arguments to f, and
returns a fn that takes a variable number of additional args. When
called, the returned function calls f with args + additional args.
differs from the core version in that it works on just one argument."
{:added "1.0"}
([f] f)
([f arg1]