Skip to content

Instantly share code, notes, and snippets.

View dstevensio's full-sized avatar

Dave Stevens dstevensio

View GitHub Profile
@dstevensio
dstevensio / jsonParsing.js
Created November 10, 2015 19:25
Wrap JSON.parse in try/catch
try {
JSON.parse(jsonSource);
} catch (e) {}
@dstevensio
dstevensio / bash.md
Last active December 9, 2015 21:58
Bash Aliases for bash profile changes

In ~/.bash_profile or ~/.bashrc (whichever you use)

alias ebash="sudo vi ~/.bash_profile"
alias rbash="source ~/.bash_profile"

Change ~/.bash_profile to ~/.bashrc if you're using the latter.

When you need to edit your bash config, you can

@dstevensio
dstevensio / binding.jsx
Created January 7, 2016 18:37
Binding in React with React.Component use
class MyComponent extends React.Component {
constructor(props) {
super(props);
this._myHandlerFunc = this._myHandlerFunc.bind(this);
}
_myHandlerFunc() {
// do something
}