Skip to content

Instantly share code, notes, and snippets.

View mladenoff's full-sized avatar
🤚
Hey

Isak Mladenoff mladenoff

🤚
Hey
View GitHub Profile
@mladenoff
mladenoff / lightweight-selector.md
Last active December 1, 2017 01:04
An easy lodash selector for you!

This is a lightweight selector that can be used to match up something like your users (or playlists) slice of state (in this case an object) with your followees (the users you follow, in this case an array of userIds). Also works for something like photos or posts and your likedPosts/Photos array.

// fronted/reducers/selectors.js

import * as _ from 'lodash';

export const selectUsersByFollowees = (users, followees) => (
  _.filter(
 Object.values(users),
@mladenoff
mladenoff / search-lite.md
Last active November 29, 2017 01:14
Search Lite

API Util

// track_api_util.js

export const fetchSearchResults = search => (
  $.ajax({
    method: 'POST',
    url: '/api/tracks/search',
    data: search,
 })
@mladenoff
mladenoff / airbnb-linter-setup.md
Last active September 20, 2017 04:12
AIrbnb linter setup for your full-stack project

The following will set up the fabled Airbnb JavaScript linter for your project. There will be a lot of red at first, but then there will be harmony and beauty.

Paste this command in your project directory:

~/full-stack$ (export PKG=eslint-config-airbnb; 
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)
@mladenoff
mladenoff / redux-dev-tool-setup.md
Last active September 20, 2017 04:11
Redux Dev Tool setup

Redux Dev Tools setup

The actual instructions for the Redux Dev Tools are overly complex and obtuse for 99% of what you will need. This will get you all set-up with one Chrome extension, one package installation, and just one additional line of code.

Set these up, you will be glad you did.

Instructions

First, install the Chrome extension.