Skip to content

Instantly share code, notes, and snippets.

View wolverineks's full-sized avatar
🌴
On vacation

Kevin Sullivan wolverineks

🌴
On vacation
View GitHub Profile
Verifying that +wolverineks is my Bitcoin username. You can send me #bitcoin here: https://onename.io/wolverineks
@wolverineks
wolverineks / .gitconfig
Created September 11, 2017 20:48
Better Git Log™
[format]
# automatically formats “git log”
# %h = abbreviated commit hash
# %ad = date of commit
# %an = author’s name
# %s = commit short message (synopsis)
# %C = change color of output text
# %<(50,trunc) = truncate next output to 50 chars
pretty = %C(yellow)%h %C(red)%<(14)%ad %C(blue)%<(15,trunc)%an %C(reset)%<(50,trunc)%s
@wolverineks
wolverineks / slack-dark-theme.css
Last active September 28, 2017 22:33
slack dark theme
/*
Copyright 2017 Bryan Keller (https://github.com/widget-)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@wolverineks
wolverineks / react-alias-component.js
Last active October 14, 2017 00:01
React Alias Components
import React, {Component} from 'react'
import Icon from '...'
import {
Text,
TouchableOpacity,
View
} from 'react-native'
import styles from './styles'
@wolverineks
wolverineks / react-alias-component.js
Last active October 13, 2017 23:41
react-alias-components-after
import {
AlertContainer,
AlertHeader as Header,
AlertIcon as Icon,
AlertText as Text
AlertBody as Body,
AlertFooter as Footer
} from '../Alert/'
import {SubmitButton, CancelButton} from '../Buttons'
@wolverineks
wolverineks / react-alias-components.js
Last active October 14, 2017 00:14
react-alias-components
// Alert/AlertContainer.js
import React, {Component} from 'react'
import {View} from 'react-native'
import styles from '../styles'
export default AlertContainer extends Component {
render () {
const {children, style} = this.props
return <View style={{styles.alert, ...style}}>
@wolverineks
wolverineks / index.js
Last active November 12, 2017 23:38
redux-keto example
const keto = require('redux-keto')
const buildReducer = keto.buildReducer
const maxCount = (state = 0, action) =>
action.type === 'CHANGE_MAX_COUNT'
? action.payload
: state
const counter = (state = 0, action, next) =>
Math.min(next.maxCount, action.type === 'INCREMENT' ? state + action.payload : state)
@wolverineks
wolverineks / 00-typical-component.js
Last active January 5, 2018 19:36
Traditional vs Empty-Box React components
import {View, Text, TouchableHighlight} from 'react-native'
class MyButtonRow extends React.Component {
someLifecycleMethod1 () { '...' }
someLifecycleMethod2 () { '...' }
someLifecycleMethod3 () { '... '}
render () {
const {
containerStyle,
@wolverineks
wolverineks / 00-before.js
Last active January 24, 2018 03:07
Using Array.prototype.map
const URI = require('uri-js')
const uri = 'custom://recovery?token=IamToken&nextVar=nextVar'
const doTheSideEffect = (token) => console.log(token)
doTheWholeEnchilada (uri) {
if (!uri) return
const parsedUri = URI.parse(uri)
const query = parsedUri.query
const splitArray = query.split('token=')
@wolverineks
wolverineks / 000-helperTypes.js
Created February 6, 2018 20:04
Proposed Redux State
export type WalletId = string
export type CurrencyCode = string
export type IsoCurrencyCode = string
export type PluginName = string
export type SceneKey = string
export type SceneData = Object