Skip to content

Instantly share code, notes, and snippets.

View apuravchauhan's full-sized avatar

Apurav Chauhan apuravchauhan

View GitHub Profile
@apuravchauhan
apuravchauhan / index.ftl
Created September 15, 2018 18:43
Java freemarker template converted from ReactJS JSX component
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Apurav Chauhan</title>
</head>
<body>
@apuravchauhan
apuravchauhan / like-button.html
Last active September 9, 2018 19:23
React JSX component to be server side rendered on java, spring , freemarker template engine
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Apurav Chauhan</title>
</head>
<body>
<div id="root">Loading...</div>
@apuravchauhan
apuravchauhan / countylist.txt
Last active February 4, 2019 18:34
257 Countries list
//Source: http://www.listofcountriesoftheworld.com/
Afghanistan
Akrotiri
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
@apuravchauhan
apuravchauhan / country-dial-codes.json
Created February 3, 2018 06:23
Country List with Dial Codes
let countries =[
{ccode:"US",value:"1",name:"USA",mcode:"+1"},
{ccode:"GB",value:"44",name:"UK",mcode:"+44"},
{ccode:"DZ",value:"213",name:"Algeria",mcode:"+213"},
{ccode:"AD",value:"376",name:"Andorra",mcode:"+376"},
{ccode:"AO",value:"244",name:"Angola",mcode:"+244"},
{ccode:"AI",value:"1264",name:"Anguilla",mcode:"+1264"},
{ccode:"AG",value:"1268",name:"Antigua & Barbuda",mcode:"+1268"},
{ccode:"AR",value:"54",name:"Argentina",mcode:"+54"},
@apuravchauhan
apuravchauhan / gurbani-quotes.json
Last active December 23, 2017 15:59
gurbani quotes
[
{
"gur": "ਦਯਿ ਵਿਗੋਏ, ਫਿਰਹਿ ਵਿਗੁਤੇ; ਫਿਟਾ, ਵਤੈ ਗਲਾ ॥",
"eng": "Ruined by the Merciful Lord, they wander around in disgrace, and their entire troop is contaminated."
}, {
"gur": "ਜੀਆ ਮਾਰਿ ਜੀਵਾਲੇ ਸੋਈ; ਅਵਰੁ ਨ ਕੋਈ ਰਖੈ ॥",
"eng": "The Lord alone kills and restores to life; no one else can protect anyone from Him."
}, {
"gur": "ਦਾਨਹੁ ਤੈ ਇਸਨਾਨਹੁ ਵੰਜੇ; ਭਸੁ ਪਈ ਸਿਰਿ ਖੁਥੈ ॥",
"eng": "They go without giving alms or any cleansing baths; their shaven heads become covered with dust."
Verifying my Blockstack ID is secured with the address 1HuewHgGzkuuLVvWHLNN1hCVEeX9Lekf5u https://explorer.blockstack.org/address/1HuewHgGzkuuLVvWHLNN1hCVEeX9Lekf5u
@apuravchauhan
apuravchauhan / server.xml
Created November 24, 2017 14:59
Tomcat's server.xml with RemoteIpValve settings snippet
.
.
.
.
<Engine defaultHost="localhost" name="Catalina">
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="127\.0\.[0-1]\.1"
remoteIpHeader="x-forwarded-for"
@apuravchauhan
apuravchauhan / nginx.conf
Created November 24, 2017 14:28
NGINX SSL Configuration Snippet
.
.
.
server {
listen 443 ssl http2;
server_name localhost;
ssl_certificate /etc/ssl/certs/myssl.crt;
ssl_certificate_key /etc/ssl/private/myssl.key;
@apuravchauhan
apuravchauhan / HelloController.java
Created November 24, 2017 14:11
Sample URL exposed
package com.apuravchauhan.web.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
*
@apuravchauhan
apuravchauhan / gist:feb36ef06a7ad1724ccf61425c17bbb9
Created November 12, 2017 06:08
Part 2 - Final HTML for our Air Pollution App
<ion-header>
<ion-navbar>
<ion-buttons start>
<button menuToggle ion-button icon-only style="color:white">
<ion-icon name="ios-menu"></ion-icon>
</button>
</ion-buttons>
<ion-title>AIR POLLUTION</ion-title>
<ion-buttons end>