Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean Michael seansean11

View GitHub Profile
@seansean11
seansean11 / store-types.ts
Last active Jun 28, 2020
Using Redux Thunk with Typescript (example)
View store-types.ts
import { ActionCreator } from 'redux'
import { ThunkAction } from 'redux-thunk'
import { WebService } from 'app/services/WebService'
// Create this reusable type that can be imported into your redux action files
export type ThunkResult<R> = ThunkAction<R, RootState, Services, RootAction>
// Services are only necesarry because we are using
// `reduxThunk.withExtraArgument({ webService }))` when we are creating our store.
export type Services = {
View ES6 Promise Chain
// ES6 PROMISE CHAIN //
exports.seed = (knex) =>
knex('user_role').del()
.then(() => knex.insert(data.user_roles).into('user_role'))
.then(() => knex('user_address').del())
.then(() => knex.insert(data.user_addresses).into('user_address'))
.then(() => knex('user').del())
.then(() => knex.insert(data.users).into('user'));
View .vimrc
set nocompatible " required
filetype off " required
" Enable syntax highlighting
set number
" Allow backspacing in insert mode
set backspace=2
" Highlight all search results
@seansean11
seansean11 / .gitignore
Last active May 1, 2017
.gitignore for WordPress themes
View .gitignore
# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/
# Ignore those unneeded sass-cache + node_modules files.
.sass-cache
.sass-cache/*
node_modules/
View Git Commands
Undo previous commit
`git revert HEAD^`
Modify previous commit message
`git commit --amend`
Temporarily stash changes
`git stash`
Restore changes from stash
You can’t perform that action at this time.