Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
A good developer is always learning…

Sai Nikhil iamsainikhil

👨‍💻
A good developer is always learning…
View GitHub Profile
@iamsainikhil
iamsainikhil / responsive-request-desktop-site.js
Created Jan 24, 2021 — forked from dtipson/responsive-request-desktop-site.js
How to make responsive sites better respect the "Request a desktop site" feature on modern mobile browsers.
View responsive-request-desktop-site.js
/*
Enable the "Request Desktop Site" functions on mobile chrome (android and iOS) allow users to see desktop layouts on responsive sites. Note that this is distinct from "opt out of mobile!" buttons built into your site: this is meant to work with the browser's native opt-in/opt-out functionality.
Since these functions work, in part, by simply spoofing the user agent to pretend to be desktop browsers, all we have to do is just remember that the browser once claimed to be android earlier in the same session and then alter the viewport tag in response to its fib.
Here's an example viewport tag <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> that we'd be setting to scaleable-yes,max scale=2. That's just an example of something that works on the site I was building: you should customize the "desktop" viewport content setting to whatever works for your site's needs. If you wanted, you could stick this code in the head just after the primary viewport tag so that the br
View print.css
.wrapper {
max-width: 612px;
height: 100%;
background: #fff;
}
.report-wrapper {
margin-right: 3rem;
margin-left: 3rem;
}
.report-title {
@iamsainikhil
iamsainikhil / urban_areas.json
Last active Feb 26, 2020
Mappings of Urban Areas to slug:urban_area of Teleport City Info API
View urban_areas.json
{
"Aarhus": "aarhus",
"Adelaide": "adelaide",
"Albuquerque": "albuquerque",
"Almaty": "almaty",
"Amsterdam": "amsterdam",
"Anchorage": "anchorage",
"Andorra": "andorra",
"Ankara": "ankara",
"Asheville": "asheville",
@iamsainikhil
iamsainikhil / iso3166_codes.json
Last active Feb 2, 2020
ISO 3166 country codes
View iso3166_codes.json
[{"Code": "AF", "Name": "Afghanistan"},{"Code": "AX", "Name": "\u00c5land Islands"},{"Code": "AL", "Name": "Albania"},{"Code": "DZ", "Name": "Algeria"},{"Code": "AS", "Name": "American Samoa"},{"Code": "AD", "Name": "Andorra"},{"Code": "AO", "Name": "Angola"},{"Code": "AI", "Name": "Anguilla"},{"Code": "AQ", "Name": "Antarctica"},{"Code": "AG", "Name": "Antigua and Barbuda"},{"Code": "AR", "Name": "Argentina"},{"Code": "AM", "Name": "Armenia"},{"Code": "AW", "Name": "Aruba"},{"Code": "AU", "Name": "Australia"},{"Code": "AT", "Name": "Austria"},{"Code": "AZ", "Name": "Azerbaijan"},{"Code": "BS", "Name": "Bahamas"},{"Code": "BH", "Name": "Bahrain"},{"Code": "BD", "Name": "Bangladesh"},{"Code": "BB", "Name": "Barbados"},{"Code": "BY", "Name": "Belarus"},{"Code": "BE", "Name": "Belgium"},{"Code": "BZ", "Name": "Belize"},{"Code": "BJ", "Name": "Benin"},{"Code": "BM", "Name": "Bermuda"},{"Code": "BT", "Name": "Bhutan"},{"Code": "BO", "Name": "Bolivia, Plurinational State of"},{"Code": "BQ", "Name": "Bonaire, Sint E
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Formatting Dates</title>
</head>
<script src="https://cdn.jsdelivr.net/momentjs/2.14.1/moment-with-locales.min.js"></script>
<body>
<script id="jsbin-javascript">
@iamsainikhil
iamsainikhil / index.html
Last active May 16, 2019
A Robust Weather App using JavaScript by Sai Nikhil | CodePen -> https://codepen.io/iamsainikhil/pen/BqNzbM
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>A Robust Weather App using JavaScript by Sai Nikhil</title>
<link href="https://fonts.googleapis.com/css?family=Space+Mono" rel="stylesheet">
<style>
#app {
display: flex;
@iamsainikhil
iamsainikhil / The Technical Interview Cheat Sheet.md
Created Aug 29, 2018 — forked from TSiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@iamsainikhil
iamsainikhil / randomFigures.html
Created Aug 9, 2018
Randomly Generated Canvas Figures
View randomFigures.html
<!DOCTYPE html>
<html>
<head>
<title>Random Figures</title>
<style>
.canvas-wrapper {
display: flex;
margin: 10px auto;
}
@iamsainikhil
iamsainikhil / reactionTest.html
Last active Aug 9, 2018
Reaction Tester Game
View reactionTest.html
<!DOCTYPE html>
<html>
<head>
<title>Reaction Tester</title>
<style>
.canvas-wrapper {
display: flex;
margin: 10px auto;
}
@iamsainikhil
iamsainikhil / README.md
Created Jun 23, 2018 — forked from CodingDoug/README.md
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions
View README.md