Skip to content

Instantly share code, notes, and snippets.

View VarunBatraIT's full-sized avatar
🎯
Focusing

Varun Batra VarunBatraIT

🎯
Focusing
View GitHub Profile
@VarunBatraIT
VarunBatraIT / Favorite Books.md
Created June 6, 2016 16:50 — forked from janikvonrotz/Favorite Books.md
List of my favorite books #JanikVonrotz

Frank Schätzing

  • Limit

Stephen King

  • The Dark Tower series
  • Under the Dome

Christopher Paolini

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
var http = require('http');
var path = require('path');
var cluster = require('cluster');
var os = require('os');
var fs = require('fs');
var debug = true;
if (!cluster.isMaster) {
var F = require('total.js');
@VarunBatraIT
VarunBatraIT / custom-error-page
Created July 6, 2016 10:15 — forked from simlegate/custom-error-page
Nginx return custom json
error_page 400 404 405 =200 @40*_json;
location @40*_json {
default_type application/json;
return 200 '{"code":"1", "message": "Not Found"}';
}
error_page 500 502 503 504 =200 @50*_json;
location @50*_json {

Two different domains.

  • Please consider that your backend is running at backendserver.com and angular app is running at frontendserver.com

Three databases

  • information_db will contain a table shops with columns shop_name, db_name & reqeusts like
id shop_name db_name requests
1 Shop A shop_a 0
2 Shop B shop_b 0
@VarunBatraIT
VarunBatraIT / react_rails_redux.sh
Created October 7, 2017 17:33
Rails with React, Redux, ES6, Webpack, and Gulp
# Create rails app
gem install make_it_so
make_it_so rails <name>
rake db:create db:migrate db:test:prepare && rspec
# get NPM set up (make sure node is installed)
npm init
npm install --save babel-loader gulp webpack gulp-webpack react redux react-redux
touch webpack.config.js
vim webpack.config.js
[Unit]
Description=Elasticsearch
Documentation=http://www.elastic.co
Wants=network-online.target
After=network-online.target
[Service]
RuntimeDirectory=elasticsearch
Environment=ES_HOME=/usr/share/elasticsearch
Environment=ES_PATH_CONF=/etc/elasticsearch/elasticsearch.yml

Please upload codes to github and share the url when you start the test.

Two different domains and Two Systems Client/Server.

  • Please consider that your backend is running at backendserver.com and html/css/jQuery OR angular/react app is running at frontendserver.com
  • Your server doesn't contain any codes of client. Both are mutually independent of each other. One laravel app is just a rest api, other app is nothing but simple forms built with angular/react or just jquery.

Three databases

  • information_db will contain a table shops with columns shop_name, db_name & reqeusts like

|id|shop_name|db_name|requests|

Situation

  • We have three files - page.html, sidebard.html, main.html

page.html

  • Head only has jQuery
  • Body has three divs with id timestamp, sidebar and main.

main.html content

Situation

  • HTML body is black.
  • Head only has jQuery

Assignment

  • Create 100 li under ul - numbered 1,2,3 to 100 using jQuery
  • if clicked on any li, that li will be removed using jQuery