Skip to content

Instantly share code, notes, and snippets.

View zedd45's full-sized avatar
😁
I may be slow to respond.

Chris Keen zedd45

😁
I may be slow to respond.
View GitHub Profile
@zedd45
zedd45 / branch.fish
Created June 6, 2018 14:20
fish function for common git workflow
function branch
git stash save "saving temporary state of branch $argv"
git checkout $argv
git branch -u origin/develop
git stash pop
end
@zedd45
zedd45 / react-redux.md
Last active June 24, 2017 18:29
React + Redux Clarification

Discussion with a mentoree / pupil of mine about how React Redux works

React (view) lives separately from Redux (data management).

bingo

In order for react-redux to communicate to each other there needs to be a connector { connect } from react-redux.

There are ways around this, perhaps, but bingo again (you could write your own connect, like apollo did, but it just ties in with Redux, anyway 😛 piggyback

@zedd45
zedd45 / failureToConnect.md
Last active November 28, 2016 20:05
What we have here, is a failure to communicate

If you ever get errors about wrapWithConnect taking a null or undefined component, it’s because you forgot to wrap the component.

Here's the error message I got, for convienence / reference:

wrapWithConnect(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.

wrong:

@zedd45
zedd45 / EventTable.jsx
Last active August 25, 2016 22:02
Redux: cannot read displayName of undefined (Redux + Karma Webpack)
import React from 'react';
import { connect } from 'react-redux';
import EventTableComponent from './EventTableComponent';
import { fetchData } from '../../actions';
const mapStateToProps = (state, ownProps) => {
return {
@zedd45
zedd45 / event-creator.spec.js
Created June 27, 2016 20:47
Karma + Webpack + fetch-mock
import configureMockStore from 'redux-mock-store';
import * from '../actions';
// must come before fetch-mock
import 'isomorphic-fetch';
import fetchMock from 'fetch-mock';
import thunk from 'redux-thunk';
const expect = chai.expect;
const fixtureData = require('aFixtureFile');
const mock = fetchMock.mock;
'use strict';
class Animal {
constructor () {
}
eat (food) {
@zedd45
zedd45 / rec-nock.js
Last active September 10, 2015 20:08
Nock Record - Thanks @dbretoi
/**
* For use with Nocking Hapi Requests (with Lab)
* Nock: https://github.com/pgte/nock/
* Hapi: http://hapijs.com/api
* Lab: https://github.com/hapijs/lab
*/
// npm deps
var Nock = require('nock');
@zedd45
zedd45 / Angular-U-Doug-Crockford.md
Last active August 29, 2015 14:23
Doug's Talk on what comes after HTML

Talk 9: Douglas Crockford: Security

History

  • with diskdrives, we have programs sharing the same spaces, so passwords appear
  • shared time on a processor is next
    • prevents access to other users
    • ensures the CPU time is "paid for"
  • As the web grows, humans cannot remember their passwords
@zedd45
zedd45 / includecustomloginlinks.php
Created January 20, 2015 20:17
Wordpress Login LInks for header navigation
@zedd45
zedd45 / index.php
Last active August 29, 2015 14:13
Disable recover password email in Profile Builder for Wordpress
<?php
/**
* Plugin Name: Profile Builder Recover Password - No Confirmation Email
* Plugin URI: http://webbridgestudios.com/
* Description: Sending a password in plain text is a security risk. Disable the email that PB sends when a user preforms "recover password" action.
* Version: 0.1.3
* Author: Chris Keen
* Author URI: http://github.com/zedd45
* License: Dual License: GPL2 / MIT
*/