Skip to content

Instantly share code, notes, and snippets.

View saipraveen-a's full-sized avatar
:octocat:
Working From Home

Sai Praveen saipraveen-a

:octocat:
Working From Home
View GitHub Profile
@saipraveen-a
saipraveen-a / fix-index.html
Created October 13, 2020 12:37
HTML & CSS Challenges - External Style Sheet
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>CSS Challenge - Move to External Stylesheet</title>
</head>
<body>
<h1>The Header</h1>
<p style="">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
@saipraveen-a
saipraveen-a / fix-index.html
Last active October 13, 2020 12:35
HTML & CSS Challenges - Image
<!DOCTYPE html>
<html>
<head>
<title>HTML Challenge - Fix This Image</title>
</head>
<body>
<img src="https://images.unsplash.com/photo-1441974231531-c6227db76b6e?&w=400" alt="Trees in a forest">
</body>
@saipraveen-a
saipraveen-a / main-intro.html
Created October 13, 2020 12:28
Building a Multi-Column Layout
<html>
<head>
<title>HTML & CSS</title>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<header>
<h1>I'm learning HTML and CSS</h1>
</header>
@saipraveen-a
saipraveen-a / style.css
Created October 13, 2020 11:58
CSS Borders
/* Snippet1 */
header {
width: 100px;
border-color: yellow;
border-width: 20px;
border-style: solid;
padding: 20px;
margin: 20px;
@saipraveen-a
saipraveen-a / index-1.html
Last active October 13, 2020 11:25
Inline CSS Basics
<html>
<head>
<title>Introduction to CSS</title>
</head>
<body>
<!--
#42f4df
#f77002
#13a351
rgb(206, 105, 72)
@saipraveen-a
saipraveen-a / GitHub-GraphQL-Query.md
Last active October 3, 2020 04:13
GraphQL Reference Queries and Mutations

Get Repositories

``query GetRepositories { repository(name: "test-bottle-app", owner: "saipraveen-a") { name parent { name } createdAt watchers {

@saipraveen-a
saipraveen-a / index.js
Created September 19, 2020 14:03
JavaScript Understanding the Weird Parts - Classes in ES6
// classes are just syntatic sugar in Javascript. They are just objects underneath
class Person {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
greet() {
return 'Hi' + firstName;
}
@saipraveen-a
saipraveen-a / README.md
Created September 19, 2020 13:51
JavaScript Understanding the Weird Parts - Creating Objects using Object.create

Function Constructors were added for programmers coming from OO programming backgrounds.

Javascript also supports creating Objects using its own Prototypal Inheritance through the use of Object.create()

Objects dont create new Execution Context. Only a function invocation results in the Creation and Execution of new Execution Context.

Object.create is supported in newer browser versions. If we have to run our application in older browsers, we can instead use Polyfills (code that adds a feature that the engine may lack)

@saipraveen-a
saipraveen-a / index.js
Created September 19, 2020 13:29
JavaScript Understanding the Weird Parts - Array for in
const names = ['John', 'Jane', 'Joe']
for (let key in names) {
console.log(key + ": " + names[key]); // array is an object with the key being the index
}
Array.prototype.someNewProperty = 'abc';
// now we get the new property someNewProperty in the output as well.
for (let key in names) {
@saipraveen-a
saipraveen-a / index.js
Last active September 19, 2020 13:16
JavaScript Understanding the Weird Parts - Built-In Function Constructors
let a = new Number(3);
a;
a.toFixed(2);
Number.prototype.toFixed(2);
let b = new String('John');
b.indexOf('o');
String.prototype.indexOf('o');