Skip to content

Instantly share code, notes, and snippets.

@junyong
junyong / setup.sh
Last active October 1, 2021 09:07
aws ec2 ubuntu setup shell script (curl -s -L URL | bash)
#! /bin/bash
sudo apt update
sudo apt upgrade -y
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install pm2 -g
pm2 install pm2-logrotate
<!DOCTYPE html>
<html lang="ko">
<head>
<title>responsive web design</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
@media screen and (max-width: 640px) {
html { background: red; }
}
@junyong
junyong / api.js
Created July 16, 2012 06:48 — forked from fwielstra/api.js
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');