Skip to content

Instantly share code, notes, and snippets.

View msell's full-sized avatar

Matt Sell msell

View GitHub Profile
@msell
msell / install-plugins.sh
Last active July 24, 2019 22:20
VS Code Settings
code --install-extension amatiasq.sort-imports
code --install-extension christian-kohler.npm-intellisense
code --install-extension CoenraadS.bracket-pair-colorizer-2
code --install-extension DotJoshJohnson.xml
code --install-extension dsznajder.es7-react-js-snippets
code --install-extension eamodio.gitlens
code --install-extension EditorConfig.EditorConfig
code --install-extension erichbehrens.pull-request-monitor
code --install-extension esbenp.prettier-vscode
code --install-extension formulahendry.auto-rename-tag
@msell
msell / get.js
Created May 29, 2019 14:48
get alternative
const get = (obj, path, defaultValue) => {
const result = path.reduce((xs, x) => (xs && xs[x]) ? xs[x] : null, obj);
if(result === null) {
return defaultValue;
}
return result;
}
const props = {
/* ********** CHOOSE YOUR PATH ************ */
/* The purist */
function Component({ color }) {
// JS way
return (
<div className={css({ color: 'red' })}>hi</div>
)
// CSS way
return (
<div className={css(`color: red`)}>hi</div>
@msell
msell / open-pull-requests.qraphql
Last active May 9, 2018 02:45
Github GraphQL Queries
{
repository(name: "ProductFulfillment", owner: "OneTechLP") {
name
pullRequests(last: 20, states: OPEN) {
edges {
node {
url
changedFiles
author {
login
@msell
msell / blackjack.js
Created March 9, 2018 21:22
blackjack kata
const count = (cards) => {
const aces = cards.filter(x => x === 'A')
const withoutAces = cards.filter(x => x !== 'A')
const sortedCards = [...withoutAces, ...aces]
return sortedCards.reduce((sum, card) => {
return sum += cardValue(card, sum)
}, 0)
}
@msell
msell / crosstreck_maintenance.json
Created January 21, 2018 05:12
Maintenance schedule for crosstrek
{
"actionHolder": [
{
"id": 4600815,
"engineCode": "4HNAY2.0",
"transmissionCode": "AUTOMATIC",
"intervalMileage": 12000,
"intervalMonth": 30,
"frequency": 4,
"action": "Inspect",
@msell
msell / highlader_maintenance.json
Created January 21, 2018 05:10
Maintenance schedule for 2015 Highlander
{
"actionHolder": [
{
"id": 2137971,
"engineCode": "4INAG2.7",
"transmissionCode": "ALL",
"intervalMileage": 100000,
"intervalMonth": 120,
"frequency": 4,
"action": "Flush/replace",
@msell
msell / fsm.json
Last active January 18, 2018 22:35
auth fsm
{
"id": "authentication",
"initial": "fetchingQuestions",
"states": {
"fetchingQuestions": {
"on": {
"SUCCESS": "inProgress",
"ERROR": "failedToFetchQuestions",
"MAX_ATTMEPTS": "terminal"
}