Skip to content

Instantly share code, notes, and snippets.

View whichsteveyp's full-sized avatar

Stephen Rivas Jr whichsteveyp

View GitHub Profile
// const AppDispatcher =, etc...
module.exports = {
getCommentsForRequestWithBind(requestID, rowBusinessKey) {
superagent.get(`/api/${requestID}/comments`, this.updateRequestCommentsInRow.bind(this, requestID, rowBusinessKey), someGlobalErrorAction);
},
getCommentsForRequestLambda(requestID, rowBusinessKey) {
superagent.get(`/api/${requestID}/comments`, comments => this.updatedRequestCommentsInRow(requestID, rowBusinessKey, comments), someGlobalErrorAction);
},
@whichsteveyp
whichsteveyp / es5.js
Created March 10, 2015 17:54
I was not aware of the two syntax styles here. Are there valid uses/reasons for both?
// one
[].each(function (foo) {
return foo.info ? "hello" : "hi";
});
// two
[].each(function (foo) {
return foo.info ? "hello" : "hi";
});
@whichsteveyp
whichsteveyp / .git-completion.sh
Created September 16, 2013 22:07
Also he's a Bull's Fan. Idiot.
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@whichsteveyp
whichsteveyp / .git-prompt.sh
Created September 16, 2013 22:07
Ivan deletes things for no reason.
__gitdir ()
{
# Note: this function is duplicated in git-completion.bash
# When updating it, make sure you update the other one to match.
if [ -z "${1-}" ]; then
if [ -n "${__git_dir-}" ]; then
echo "$__git_dir"
elif [ -n "${GIT_DIR-}" ]; then
test -d "${GIT_DIR-}" || return 1
echo "$GIT_DIR"
source ~/.git-completion.sh
source ~/.git-prompt.sh
export PS1='\n\n\[\e[0;36m\][ \[\e[0;35m\]\w\[\e[0;36m\] ] $(__git_ps1 "\[\e[1;33m\]%s\[\e[0;36m\]") >\[\e[0m\] '