Skip to content

Instantly share code, notes, and snippets.

View BinaryMuse's full-sized avatar
🏳️‍🌈
Just gayin' up the place the best I can

Michelle Tilley BinaryMuse

🏳️‍🌈
Just gayin' up the place the best I can
View GitHub Profile
@arathunku
arathunku / NewsfeedStore.js
Last active August 29, 2015 14:12
Request Action, wrapper for all requests
var NewsfeedStore = Fluxxor.createStore({
initialize () {
this.loading = false;
this.error = null;
PaginatedStoreWrapper(this);
_.extend(this, (localStorage.get('NewsfeedStore') || {}));
this.bindActions(
AppBarConstants.REFRESH, this.onRefresh,
@orientalperil
orientalperil / template_graph.py
Created December 10, 2014 18:15
Create Graphviz diagrams of Django templates
import os
import functools
import fnmatch
import re
import collections
import pydot
def Walk(root='.', recurse=True, *patterns):
"""
@dandelany
dandelany / create-flux-client.js
Created November 7, 2014 21:36
Fluxxor flux-client
var Fluxxor = require('fluxxor');
var _ = require('underscore');
// A FluxClient is a special Fluxxor.Store constructor that is a wrapper around a 'client' object.
// Client objects are generally an object containing all the server calls your app can make
// FluxClient allows you to listen for Fluxxor actions and cause them to trigger requests in the client,
// this way your actions can remain pure and don't have to call the client directly.
// It can also dispatch Fluxxor actions when the client request begins and upon request success/failure
// createFluxClient creates a FluxClient constructor from two arguments:
@thomasboyt
thomasboyt / loading.md
Created October 22, 2014 15:09
Flux loading state pattern

I've been struggling to come up with a good pattern for handling loading state in Flux (specifically using Fluxxor, though I think this is an issue for any implementation).

When I say "loading state," what I mean is state in a store that tracks:

  • Whether the data handled by the store was loaded
  • Whether the store is currently attempting to load data
  • Whether the data loaded successfully or errored
  • The error message, if it errored

Here's my first (very simple) pass at this, a store mixin called LoadingStoreMixin.js:

@fishcakez
fishcakez / enter_loop.ex
Last active August 29, 2015 14:04
EnterLoop
defmodule EnterLoop do
use GenServer
require Logger
def start_link(opts) do
spawn_opts = Keyword.get(opts, :spawn_opt, [])
# :infinity start timeout
:proc_lib.start_link(__MODULE__, :init_it, [opts], :infinity, spawn_opts)
end
@rob-brown
rob-brown / ElixirConf2014.md
Last active December 4, 2020 05:38
Notes from ElixirConf 2014

ElixirConf 2014

Dave Thomas—Opening Keynote

Twitter | Slides

Think different(ly)

Get out of your rut and learn new ways to think.

@evancz
evancz / Architecture.md
Last active December 21, 2022 14:28
Ideas and guidelines for architecting larger applications in Elm to be modular and extensible

Architecture in Elm

This document is a collection of concepts and strategies to make large Elm projects modular and extensible.

We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp. You will probably merge a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:

  1. There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo
@staltz
staltz / introrx.md
Last active April 24, 2024 19:47
The introduction to Reactive Programming you've been missing
var EmbedlyComponent = React.createClass({
componentWillMount: function() {
// get 'http://api.embed.ly/1/oembed?url=' + this.props.url;
SuperAgent.get('http://api.embed.ly/1/oembed?url=' + this.props.url,
function(res) {
var data = res.body;
if (data) this.setState(data);
}.bind(this)
);
},

BoardMVC

Note: this is a draft. The rules and requirements will be finalized on July 1st 2014.

You may have seen TodoMVC which shows the same todo list, created with many different frameworks and libraries.

It's very helpful, but people often find it lacking in common requirements for a web app. It doesn't handle users, persistence, reusable components, modals, AJAX, etc.