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
class MyComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this._myHandlerFunc = this._myHandlerFunc.bind(this); | |
} | |
_myHandlerFunc() { | |
// do something | |
} |
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
try { | |
JSON.parse(jsonSource); | |
} catch (e) {} |
install presets
npm i babel-preset-stage-0 babel-preset-es2015
create/edit .babelrc
{
presets: ["es2015", "stage-0"]
}
class MyComponent extends React.Component { | |
render() { | |
return ( | |
<ul> | |
{this.props.listItems.map((item) => { | |
return <li>{item}</li>; | |
})} | |
</ul> | |
); | |
} |
const x = 12; | |
console.log(x); // 12 | |
x = 42; | |
console.log(x); // 12 (but no error) | |
const y = {}; | |
y.newProp = "value"; | |
console.log(y); // {newProp: "value"} |
// GETTING STARTED: | |
// Express | |
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res){ | |
res.send('hello world'); | |
}); |
"use strict"; | |
var joi = require("joi"); | |
var data = [{ | |
type : "A", | |
ip : "123.123.123.123" | |
}, | |
{ | |
type: "A", |
// Requires jQuery | |
// Specify a max width. This will return any elements in the DOM on the current page | |
// with a width greater than that width. Useful when debugging what element is | |
// screwing up your fluid layout | |
// NOT PRODUCTION CODE - A QUICK 'N DIRTY UTILITY TO SAVE SOME TIME DEBUGGING! | |
var maxWidth = 400; | |
jQuery("*").filter(function () { | |
if (jQuery(this).width() > maxWidth){ |