Skip to content

Instantly share code, notes, and snippets.

View faceyspacey's full-sized avatar

James Gillmore faceyspacey

View GitHub Profile
@faceyspacey
faceyspacey / camtwist_crash_report.txt
Created August 3, 2019 01:26
Camtwist Crash Report (OSX El Capitan 10.11.6, Camtwist 3.4.3)
Process: CamTwist [1578]
Path: /Applications/CamTwist/CamTwist.app/Contents/MacOS/CamTwist
Identifier: com.allocinit.CamTwist
Version: 3.4.3 (3.4.3)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: CamTwist [1578]
User ID: 501
Date/Time: 2019-08-02 18:24:51.316 -0700
@faceyspacey
faceyspacey / pathless-routes-with-redux-first-router.js
Last active June 3, 2020 00:26
Quick example showing how to use pathless routes in Redux-First Router
import api from './api'
const routesMap = {
HOME: '/', // path only route
LIST: { // route object (with a path)
path: '/list/:slug',
thunk: async (dispatch, getState) => {
const { slug } = getState().location.payload
const response = await fetch(`/api/items/${slug}`)
const items = await data.json()
@faceyspacey
faceyspacey / respond-framework_vs_concurrent-react.md
Last active December 10, 2019 14:49
how Respond Framework solves the same stuff as Concurrent React, but better without an API
createModule({
  home: '/',
  login: '/login',
  dashboard: {
    path: '/dashboard',
    module: createModule({
      settings: '/settings',
      myAccount: '/my-account',
    }, {
title date headerImage keywords
redux-first-router - Just dispatch actions - Interview with James Gillmore
2017-xx-xx
/assets/img/XXX.jpg
interview

redux-first-router flow chart

TODO: I'll fill this up and link to your Twitter (@faceyspacey)

// pages are purged when
// on userApproval in UserModel.approveCeleb
// on user update denies.js
var cloudflare_api_interface = "https://www.cloudflare.com/api_json.html";
var cloudflare_token = "YOUR_TOKEN";
var cloudflare_email = "YOUR_CLOUDFLARE_EMAIL";
var domain = 'FILL_IN_YOUR_DOMAIN';
var urls_to_purge = [
@faceyspacey
faceyspacey / meteor-accounts-twitter-auth.js
Last active June 10, 2019 17:30
meteor-accounts-twitter-auth
const Twit = Meteor.npmRequire('twit');
Accounts.registerLoginHandler('twitter', function(params) {
const data = params.twitter;
// If this isn't twitter login then we don't care about it. No need to proceed.
if (!data) {
return undefined;
}
@faceyspacey
faceyspacey / respond-framework-walkthrough.md
Last active April 25, 2019 13:03
Respond Framework Walkthrough

Respond Framework Walkthrough

Respond Framework is what happens if you build Redux & first-class concerns for routing into React, plus take a page from the traditional server-side MVC playbook when it comes to side-effects.

Here's a quick overview of the features and usage in Respond Framework.

Installation

@faceyspacey
faceyspacey / simple-functional-hypothetical-react-example.js
Last active April 24, 2019 08:28
Simple Functional Hypothetical React Example
import { Box } from 'respond'
export function Items(props) {
return Box({
style: { margin: 20, padding: 10 },
children: [
Item({ name: 'svelte' }),
Item({ name: 'react' }),
Item({ name: 'vue' }),
],
@faceyspacey
faceyspacey / respond-plus-hooks-modal.js
Last active April 8, 2019 14:03
Respond Plus Hooks Modal
const MyRespondModal = (props, state, actions) => (
<Modal
visible={!!state.modalText}
text={state.modalText}
onClose={actions.cancel}
onSubmit={actions.confirm}
/>
)
const Modal = ({ visible, text, onClose, onSubmit }) => {
@faceyspacey
faceyspacey / respond-modular-components.js
Last active April 8, 2019 10:46
Respond Modular Components
export default createApp({
components: {
App: (props, { location }) => {
const Component = location.components.list.ComponentWithHoistedDataDeps
return Component ? <Component /> : <Spinner />
},
},
routes: {
LIST: {
path: '/list/:category',