Skip to content

Instantly share code, notes, and snippets.

View nairihar's full-sized avatar
😎
Always busy

Nairi Harutyunyan nairihar

😎
Always busy
View GitHub Profile
@nairihar
nairihar / .babelrc
Created July 20, 2018 20:19
Setup React App - Organizing React Application Part 1
{
"presets":[ "env", "react" ]
}
@nairihar
nairihar / package.json
Created July 20, 2018 20:35
Setup React App - Organizing React Application Part 1
{
"name": "react-application",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js"
},
"keywords": [],
@nairihar
nairihar / index.js
Created November 7, 2018 17:49
Running across NPM
function isString(val) {
return typeof val === 'string';
}
module.exports = {
isString,
};
@nairihar
nairihar / package.json
Last active November 7, 2018 18:24
Running across NPM
{
"name": "library-like-lodash-for-article",
"version": "1.0.0",
"description": "My custom library for article.",
"main": "index.js",
"dependencies": {},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
@nairihar
nairihar / index.js
Created November 7, 2018 19:01
Running across NPM
function isString(val) {
return typeof val === 'string';
}
function isNumber(val) {
return typeof val === 'number';
}
module.exports = {
isString,
@nairihar
nairihar / LiveCode.js
Last active December 22, 2021 02:49
JavaScript Armenia | Triangle patterns | LIVE session #1 | Building and discussing 4 triangles via JavaScript !!!
/*
*
**
***
****
*****
*/
@nairihar
nairihar / index.html
Created March 24, 2020 15:33
JavaScript Armenia | Tic Tac Toe | LIVE session #2 | Building and discussing a simple Tic Tac Toe game via HTML, CSS, and JavaScript !!!
<html>
<head>
<title>Tic Tac Toe</title>
<link rel="stylesheet" type="text/css" href="./style.css" />
</head>
<body>
<div id="Board"></div>
</body>
<script src="./script.js"></script>
</html>
@nairihar
nairihar / index.html
Created March 29, 2020 15:57
JavaScript Armenia | Store | LIVE session #3 | AM
<html>
<head>
<title>Store</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div id="StoreItems"></div>
<div id="User"></div>
</body>
<script src="./user.js"></script>
@nairihar
nairihar / server.js
Last active July 14, 2022 19:09
Scaling up Node.js Socket Server with Nginx and Redis | server.js
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.end(`Hi, PID: ${process.pid}`);
});
app.listen(process.env.PORT);
console.log(`Server running on ${process.env.PORT} port, PID: ${process.pid}`);
@nairihar
nairihar / nginx.conf
Created July 14, 2022 19:10
Scaling up Node.js Socket Server with Nginx and Redis | nginx.conf
upstream nodes {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
}
server {
listen 3000;
location / {