Skip to content

Instantly share code, notes, and snippets.

View Vivek205's full-sized avatar
🏎️

Vivek Vivek205

🏎️
  • Travix
  • Amsterdam, Netherlands
View GitHub Profile
@Vivek205
Vivek205 / MuiTheme.js
Last active December 24, 2019 05:24
Sample Material UI Theme object with bare minimum data
const MuiTheme = {
palette: {
primary: {
main: "#4086ff",
dark: "#005ACB"
},
secondary: {
main: "#E67381",
dark: "#D0021B"
}
@Vivek205
Vivek205 / Providers.js
Created December 30, 2019 09:46
src/stories/
import React from "react";
import { ThemeProvider as MuiThemeProvider } from "@material-ui/styles";
const ProviderWrapper = ({ children, theme }) => <MuiThemeProvider theme={theme}>{children}</MuiThemeProvider>;
export default ProviderWrapper;
@Vivek205
Vivek205 / addons.js
Created December 30, 2019 10:06
Storybook Config
import "storybook-addon-react-live-edit/dist/register";
@Vivek205
Vivek205 / SyncMainRepoAndFork.md
Last active January 13, 2020 12:01
Sync main repo and update the fork

Fetch the latest code from main repo
git fetch upstream

Checkout development branch in fork
git checkout development

Merge the latest code from main repo
git merge upstream/development

Push the development branch

@Vivek205
Vivek205 / repo-sync.yml
Last active January 13, 2020 13:22
RepoSync yaml script
name: github - repo sync
on:
schedule:
- cron: "*/05 * * * *"
jobs:
repo-sync:
runs-on: ubuntu-latest
steps:
@Vivek205
Vivek205 / Book.proto
Last active February 29, 2020 11:29
Sample Proto
syntax = "proto3";
package com.book;
message Book {
int64 isbn = 1;
string title = 2;
string author = 3;
}
@Vivek205
Vivek205 / Book_pb.js
Last active February 29, 2020 11:32
Generated Stub Files
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
@Vivek205
Vivek205 / BookService.js
Created February 29, 2020 11:57
Executing BookService gRPC
import { grpc } from "@improbable-eng/grpc-web";
import { BookService } from "./Book_pb_service";
parseGetBookMessage = message => {
// parse the binary response back to appropriate type described in the proto
const book = {
isbn: message.getIsbn(),
title: message.getTitle(),
author: message.getAuthor()
};
@Vivek205
Vivek205 / imageLazyLoading.jsx
Created March 4, 2021 05:24
imageLazyLoading.js
const GifContainer = ({ classes, content }) => {
return (
<img
src={content}
alt="Demo Gif File"
className={classes.FullWidth}
loading="lazy"
/>
);
};
@Vivek205
Vivek205 / index.html
Created March 4, 2021 05:49
Preconnect and DNS Prefetch
<link rel="dns-prefetch" href="//static.hotjar.com">
<link rel="dns-prefetch" href="//www.google-analytics.com">
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="dns-prefetch" href="//fonts.gstatic.com">