Skip to content

Instantly share code, notes, and snippets.

View seanwash's full-sized avatar
🏠
Working from home

Sean Washington seanwash

🏠
Working from home
View GitHub Profile
@seanwash
seanwash / yaml-to-json-api.js
Last active October 5, 2016 22:34
Code Review - Build JSON API from Yaml files
'use strict'
// Use entr to auto re-run build - $ ls -d **/* | entr sh -c 'clear; node build.js'
const yaml = require('yaml-js')
const fs = require('fs')
const paths = {
guides: `${__dirname}/data/guides`,
articles: `${__dirname}/data/articles`,

Terms

Actions

An action describes user intent. It's an object with a type (required) and any sort of date.

Ex:

{
@seanwash
seanwash / question.md
Last active October 12, 2016 01:08
React/Redux/Router Flow

So, right now I have a landing page that fetches all of my data through an action.

When the user clicks to view a singular item from the landing page (items -> items/:id), should the page component dispatch an action called findItemByID, the reducer do the finding and set a {currentItem: id} object on the root store? You'd essentially have something like:

  items: { "items": [], "currentItem": 10, "fetching": false, "fetched": true, "errors": null }

How do you handle this flow in Redux? Am I doing it all wrong?

@seanwash
seanwash / job-search-notes.md
Created December 6, 2016 04:56
Sean's Job Search Notes

Job Search

Applied To:

  • Automattic - No
  • Mixmax - No, not enough experience
  • GitLab (Interviewed)
  • Rollbar (No Response)
  • Black Pixel (No Response)
  • Waldo Photos (No Response)
  • Strive HQ (No Response)
@seanwash
seanwash / DiabloIII.ahk
Created January 3, 2019 04:30 — forked from NixonInnes/DiabloIII.ahk
Diablo III Autocast Autohotkey Script
; This is an AutoHotKey script designed to be used with Diablo III
; Pressing F1 will constantly activate skill 1, F2 will activate skill 2, F3 for 3, and F4 for 4
; The keys are togglable.
Thread, interrupt, 0
togF1 := 0
$F1::
togF1 := !togF1
if (togF1) {
@seanwash
seanwash / post.md
Created August 11, 2019 22:35 — forked from LostKobrakai/post.md
Using Laravel-Mix with Phoenix

Introduction

Laravel-Mix is "an elegant wrapper around Webpack for the 80% use case". It has nothing to do with Elixir's Mix and does not require Laravel to work!

Set up

Create a new phoenix application with mix phx.new. You may choose to add the --no-brunch flag to stop brunch from being intiailized, but I personally prefer leaving that in and replacing brunch so that the folder structure is set up for me.

$ mix phx.new demo

Install Laravel-Mix

@seanwash
seanwash / tasks.json
Last active March 28, 2020 22:43
VS Code Elixir Tasks
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
//
// Mix Tasks
//
{
"label": "mix.compile (force)",
"""
""" https://github.com/JetBrains/ideavim#Files
""" https://gist.github.com/seanwash/b45169cbc5d90868f9f221191d67bec5
"""
"""
""" Plugins
"""
set surround
set commentary
# Aliases
# ----------
alias ..="cd .."
alias ll="exa --long --header --git -a"
alias n="nvim"
alias c="cd ~/Code"
alias s="cd ~/Code/sidedoor"
alias config="cd ~/.config"
alias bluetooth="sudo pkill bluetoothd" # When bluetooth gets laggy, just kill it.