Skip to content

Instantly share code, notes, and snippets.

View poudelmadhav's full-sized avatar
🕯️
Light a candle than to curse the darkness.

Madhav Paudel poudelmadhav

🕯️
Light a candle than to curse the darkness.
View GitHub Profile
@poudelmadhav
poudelmadhav / index.html
Last active November 29, 2016 06:05
Personal Resume Page
<html>
<head>
<title>Madhav Paudel</title>
<link rel="stylesheet" type="text/css" href="css/master.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
</head>
<body>
<div class="prof-box">
<!DOCTYPE html>
<html>
<head>
<title>JavaScript</title>
</head>
<body>
<script>
let d = document;
// d.querySelector("body").style.backgroundColor = "#f7f7f7";
// d.querySelector("body").style.backgroundImage = "url('images/background.jpg')";
@poudelmadhav
poudelmadhav / calculator.html
Created September 13, 2018 08:42
A simple calculator using javascript
<!DOCTYPE html>
<html>
<head>
<title>JS Calculator</title>
</head>
<body>
<div id="calc-box">
<h3 align="center">Calculator</h3>
<hr>
<table border="0" width="400">
@poudelmadhav
poudelmadhav / nav-color-change.html
Created September 22, 2018 18:24
Background color of navbar change on scroll
<div class="nav"></div>
<script>
window.onscroll = () => {
const nav = document.querySelector('.nav');
if(this.scrollY <= 500)
nav.style.backgroundColor = 'rgba(0,0,0,0)';
else
nav.style.backgroundColor = 'rgba(0,0,0,0.9)';
}
</script>
<input type="number" id="days"> <!-- the td and tr are added equal to this value -->
<input type="text" onfocus="addItineraryDays()"> <!-- function calling onfocus this input -->
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Day</th>
<th>Itineraries</th>
</tr>
</thead>
<tbody id="myTable">
@poudelmadhav
poudelmadhav / slacknotify.html
Last active February 21, 2019 07:27
An example in jquery to notify slack filled data in the contact form
<!-- Dont forget to keep your webhook url in ENV["webhook_url"] -->
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
<style>
input[type=text], select {
width: 100%;
padding: 12px 20px;
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
/************************************************************
<div id="myDropdown" class="dropdown-content">
<a href="/ja/index.html" id="JapaneseLanguage">JAPANESE</a>
<a href="/en/index.html" id="EnglishLanguage">ENGLISH</a>
</div>
*************************************************************/
$( document ).ready(function() {
var ja = document.getElementById("JapaneseLanguage");
var en = document.getElementById("EnglishLanguage");
@poudelmadhav
poudelmadhav / redirect ... to ja...js
Last active May 20, 2019 10:04
Redirect based on browser languae lambda function redirect .. to ja..
'use strict';
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
@poudelmadhav
poudelmadhav / deploy.sh
Last active October 23, 2019 06:58
sysc dist/ to aws s3 and create invalidations in cloudfront with notifying at slack
#!/bin/sh
target_env=$1
profile=$2
REPO="https://gitlab.com/namespace-inc/corporate"
SLACK_URL="https://hooks.slack.com/services/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"
CHANNEL="#corporate"
BOTNAME="deployer"