Skip to content

Instantly share code, notes, and snippets.

View heytulsiprasad's full-sized avatar
⚛️
Overreacting

Tulsi Prasad heytulsiprasad

⚛️
Overreacting
View GitHub Profile
@heytulsiprasad
heytulsiprasad / animate.md
Last active November 16, 2020 17:13
10 tips for animations

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 October 20, 2020 20:03
Write a program for postfix evaluation
#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 October 20, 2020 20:01
Write a program for conversion from infix expression to postfix expression
#include<stdio.h>
#include<ctype.h>
char stack[100];
int top = -1;
void push(char x)
{
stack[++top] = x;
}

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 October 9, 2020 12:07
Alert me extension

🚨 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 October 7, 2020 15:05
Learning about Optional Chaining
// 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)",
@heytulsiprasad
heytulsiprasad / cors.js
Last active September 26, 2020 06:49
Example setup for cors without using cors package
const origin =
process.env.NODE_ENV === "production"
? process.env.FRONTEND_PROD_URL
: process.env.FRONTEND_LOCAL_URL;
app.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", origin);
res.header("Access-Control-Allow-Credentials", true);
if (req.method === "OPTIONS") {
@heytulsiprasad
heytulsiprasad / .env
Last active September 20, 2020 16:26
Add mongoose to node and express
MONGO_PROD_URI=mongodb+srv://admin:<password>@cluster.mongodb.net/<dbname>?retryWrites=true&w=majority
MONGO_DEV_URI=mongodb://127.0.0.1:27017/<dbname>
@heytulsiprasad
heytulsiprasad / tailwind.js
Created September 4, 2020 17:55
Config tailwind to desktop first approach
module.exports = {
theme: {
extend: {},
screens: {
xl: { max: "1279px" },
// => @media (max-width: 1279px) { ... }
lg: { max: "1023px" },
// => @media (max-width: 1023px) { ... }
@heytulsiprasad
heytulsiprasad / sample.txt
Last active August 23, 2020 13:35
Sample csv file for my Array.reduce blog post
1,Donnamarie,Jemison,djemison0@ifeng.com,Female
2,Herculie,Chadbourne,hchadbourne1@opensource.org,Male
3,Shepperd,Luquet,sluquet2@so-net.ne.jp,Male
4,Sinclare,Nuttey,snuttey3@tmall.com,Male
5,Deane,Crimp,dcrimp4@paginegialle.it,Female
6,Cayla,Solman,csolman5@abc.net.au,Female
7,Mose,Magnar,mmagnar6@360.cn,Male
8,Wilfrid,Robertet,wrobertet7@ted.com,Male
9,Carney,Bantick,cbantick8@techcrunch.com,Male
10,Angelique,Marklund,amarklund9@engadget.com,Female