Skip to content

Instantly share code, notes, and snippets.

View saigowthamr's full-sized avatar
🐢
I may be slow to respond.

Sai gowtham saigowthamr

🐢
I may be slow to respond.
View GitHub Profile
@saigowthamr
saigowthamr / my-header.tsx
Created March 21, 2018 09:21
Stencil-header component
import { Component, Prop } from "@stencil/core";
@Component({
tag: "my-header",
styleUrl: "my-header.css",
shadow: true
})
export class MyHeader {
@Prop() first: string;
@Prop() second: string;
@saigowthamr
saigowthamr / my-header.css
Last active March 21, 2018 11:15
stencil-header
*{
box-sizing: border-box;
padding: 0;
margin: 0;
}
header{
padding: 1rem;
max-width: 100rem;
margin-left:auto;
@saigowthamr
saigowthamr / index.html
Created March 21, 2018 09:42
stencil html
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>my header</title>
<script src="/build/mycomponent.js"></script>
</head>
<body>
<div style="text-align:center">
<my-header first="Home" second="Posts" third="Login">
</my-header>
<h1>
Welcome to Angular {{ title }}!
</h1>
<img width="300" alt="Angular Logo" src="
data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
</div>
import { BrowserModule } from "@angular/platform-browser";
import { NgModule,CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { AppComponent } from "./app.component";
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule],
providers: [],
import React from 'react'
import PropTypes from 'prop-types'
import Helmet from 'react-helmet'
import Header from '../components/Header'
import './index.css'
const TemplateWrapper = ({ children }) => (
<div>
<Helmet
import React from 'react';
export default ()=>(
<div>
Welcome to the gatsby intro page
</div>
)
import React from 'react';
import Link from 'gatsby-link';
export default ()=>(
<div>
Welcome to the gatsby intro page
<hr/>
<Link to="/" >Move to Home</Link>
</div>
)
import React from 'react'
import Link from 'gatsby-link'
import Helmet from 'react-helmet'
export default () => (
<div>
<Helmet
title="Intro to the gatsby"
meta={[
{ name: 'description', content: 'Simple inro to gatsby' },
import React from "react";
const state = {
number: 0
};
const NumberContext = React.createContext(state.number); //passing initial value