Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Working remotely

Tulsi Prasad heytulsiprasad

💻
Working remotely
View GitHub Profile
View data_structure.js
///////////////////////////////////////////////////////////////////
/**
* currentPages is an array of objects which holds each active page
* on the browser.
*
* page: {
* id: <string>,
* url: <string>,
* author: <string>,
View fireystore.js
// Edited this from VS code
var firebaseConfig = {};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
const db = firebase.firestore();
// Read
db.collection("cafes")
View a.java
import java.util.Scanner;
public class Practice {
public static void main(String args[]) {
Scanner scr = new Scanner(System.in);
System.out.println("please enter two numbers");
int a = scr.nextInt();
int b = scr.nextInt();
@heytulsiprasad
heytulsiprasad / shopify-prop-types.js
Last active Nov 26, 2020
Validating prop types of results fetched by Shopify Storefront API
View shopify-prop-types.js
ProductForm.propTypes = {
product: PropTypes.exact({
description: PropTypes.string.isRequired,
descriptionHtml: PropTypes.string.isRequired,
handle: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
options: PropTypes.arrayOf(
PropTypes.exact({
id: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
@heytulsiprasad
heytulsiprasad / animate.md
Last active Nov 16, 2020
10 tips for animations
View animate.md

Techniques to take care while using animations

1. Don’t change any properties besides opacity or transform!

Even if you think it might be ok, don’t!

2. Hide content in plain sight.

Use pointer-events: none along with no opacity to hide elements

3. Don’t animate everything at the same time.

Rather, use choreography.

@heytulsiprasad
heytulsiprasad / postfix-eval.c
Last active Oct 20, 2020
Write a program for postfix evaluation
View postfix-eval.c
#include<stdio.h>
#include<conio.h>
#include<string.h>
#define MAX 50
int stack[MAX];
char post[MAX];
int top = -1;
void pushstack(int tmp);
void evaluate(char c);
@heytulsiprasad
heytulsiprasad / infix-postfix.c
Created Oct 20, 2020
Write a program for conversion from infix expression to postfix expression
View infix-postfix.c
#include<stdio.h>
#include<ctype.h>
char stack[100];
int top = -1;
void push(char x)
{
stack[++top] = x;
}
View semantic-commit-messages.md

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@heytulsiprasad
heytulsiprasad / intro.md
Created Oct 9, 2020
Alert me extension
View intro.md

🚨 Introducing Alert Me for Google Meet

A Chrome extension that uses the live captioning from a Meet conference to detect when specific words are spoken. You can set your own alert words in the popup interface. Never get caught while slacking off again :)

You can try out the extension by downloading the latest release from GitHub and follow the instructions in README. Link: https://github.com/heytulsiprasad/alert-me-google-meet

I'd love to know your feedback on this and how it can improve. This was my first time getting hands dirty on extensions, I'd love to discuss more ideas in future.

@heytulsiprasad
heytulsiprasad / optchains.js
Created Oct 7, 2020
Learning about Optional Chaining
View optchains.js
// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
// fiddle: https://jsfiddle.net/tulsiprasad/hou3jrf8/120
const user = {
firstName: "Jade",
lastName: "Wilson",
address: {
home: {
street: "2502 Bennie Dr",
state: "Pearson, Georgia(GA)",