Skip to content

Instantly share code, notes, and snippets.

View statianzo's full-sized avatar
🎯
Focusing

Jason Staten statianzo

🎯
Focusing
View GitHub Profile
@statianzo
statianzo / Maybe.js
Last active September 6, 2018 21:43
const Maybe = {
of (val) {
return val === null || val === undefined ? new Nothing : new Just(val)
},
catMaybes(xs) {
return xs
.filter(x => x instanceof Just)
.map(x => x.unwrap())
}

Keybase proof

I hereby claim:

  • I am statianzo on github.
  • I am staten (https://keybase.io/staten) on keybase.
  • I have a public key ASDaKdLMDNGYorowF6pQqpN0a_UfBgYbnLZsix-wyoOrUAo

To claim this, I am signing this object:

@statianzo
statianzo / GitLineHistory.vim
Last active August 14, 2017 22:07
View the history of selected lines in git
function! GitLineHistory() range
exec ":vs | te git log -L '" . a:firstline . "," . a:lastline . ":%'"
endfunction
command! -range GitLineHistory <line1>,<line2>call GitLineHistory()
[npmissue](master)$ npm outdated
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jasonstaten/.npm/_logs/2017-06-20T20_26_27_431Z-debug.log
//@flow
import React from 'react';
import Styled from './Styled';
import {View, TouchableOpacity, Text} from 'react-native';
type Props = {
children?: any,
};
import React from 'react';
import {
View,
Image,
ListView,
ScrollView,
Text,
TouchableHighlight,
TouchableNativeFeedback,
@statianzo
statianzo / current.js
Last active August 30, 2016 13:47
unknown props warning
const ContactBadge = (props) => (
<div className='Badge' {...props}>
<div>{props.user.name}</div>
<div>{props.contactMethod.type}</div>
</div>
);
export default connect((state, {userId, contactMethodId}) => ({
user: selectUser(state, userId),
contactMethod: selectContactMethod(state, contactMethodId)
@statianzo
statianzo / javascript.snippets
Created June 21, 2016 17:20
snipmate.vim javascript snippets
snippet rsc
const ${1:`Filename()`} = (props) => (
<div>
</div>
);
export default $1;
snippet rc
class ${1:`Filename()`} extends React.Component {
render() {
return (
@statianzo
statianzo / Main.js
Created May 23, 2016 20:31
Purescript Counter
(function(exports) {
// Generated by psc version 0.8.5.0
"use strict";
var Prelude = PS["Prelude"];
var Control_Monad_Aff = PS["Control.Monad.Aff"];
var Control_Monad_Eff = PS["Control.Monad.Eff"];
var Halogen = PS["Halogen"];
var Halogen_Util = PS["Halogen.Util"];
var Halogen_HTML_Indexed = PS["Halogen.HTML.Indexed"];
var Halogen_HTML_Properties_Indexed = PS["Halogen.HTML.Properties.Indexed"];
set wildignore +=*/.git/*
set wildignore +=*.ipc
set wildignore +=*.swp
set wildignore +=target
set wildignore +=project
set wildignore +=lib_managed
set wildignore +=_site
set wildignore +=node_modules
set wildignore +=cache