Skip to content

Instantly share code, notes, and snippets.

Post as many JavaScript errors as you can by breaking the provided code. Try to come up with explanation of the error you get. Prizes for the weirdest error.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Babel Quickstart</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.21.1/babel.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.js"></script>
</head>
<body>

Deploying Express App on AWS

Stuff to install on Ubuntu

  • nvm - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
  • Node.js - nvm install v6.0.0
  • pm2 - npm install pm2 -g

Stuff to configure on Ubuntu

@airportyh
airportyh / app.js
Last active January 24, 2017 20:50
Quickstart template for getting started with learning basic React and Redex without all the cruft of setting up a build environment.
class MyThing extends React.Component{
increment() {
store.dispatch({ type: 'increment' });
}
decrement() {
store.dispatch({ type: 'decrement' });
}
render() {
@airportyh
airportyh / app.js
Last active January 20, 2017 14:31
Quickstart template for getting started with learning basic React without all the cruft of setting up a build environment.
class MyThing extends React.Component{
render() {
return <div>Hello, world!</div>;
}
}
ReactDOM.render(<MyThing/>, document.getElementById('root'));
@airportyh
airportyh / quickstart.html
Created January 14, 2017 14:13
Quickstart HTML file for getting started with learning basic React without all the cruft of setting up a build environment.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Babel Quickstart</title>
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.js"></script>
</head>
<body>

Please paste your errors as comments into this gist. Paste both your code and the error message.

Install Node.js on EC2 Ubuntu

  1. Clone source code for your project and put it under /var/www
  2. Install pm2 on your server: sudo npm install pm2 -g
  3. Enable proxy module for Apache: sudo a2enmod proxy_http
  4. Start your Node.js server program using pm2: pm2 start backend.js, now you can monitor your server processes via pm2 list
  5. Create an Apache site configuration .conf file under /etc/apache2/sites-available. Let say it's mysite.conf It should look something like:

Dump

$ pg_dump -Fc -d DBNAME -f DBNAME.dump

Replace DBNAME with the name of your database.

Restore

@airportyh
airportyh / README.md
Created September 23, 2016 13:43
Catalog of Python Errors

Enter a python error message, and the example code that caused that error.