Skip to content

Instantly share code, notes, and snippets.

View nightcoder26's full-sized avatar
๐Ÿ’œ
Living

bhavitha. nightcoder26

๐Ÿ’œ
Living
View GitHub Profile
@nightcoder26
nightcoder26 / injection-attack.md
Created October 18, 2025 14:30
diff between regular js and react's jsx while handling injections

Regular html against injections

  <div id="hello">
  <script>
  const inp = "<img src='x' onerror ='alert(\"whoops, hacked!\")'>"
  document.getElementById("hello").innerHTML =  inp;
  </script>
  </div>

This executes the code, and pops up an alert.

@nightcoder26
nightcoder26 / react-class-component.jsx
Last active October 18, 2025 14:34
Example react class component
class Component extends React.Component{
constructor(props)
{
super(props);
this.state = {count:0};
}
increment = () =>
{
this.setState({count: this.state.count + 1});
@nightcoder26
nightcoder26 / pre_post_to_infix.c
Created March 21, 2023 17:29 — forked from priyadarshitathagat/pre_post_to_infix.c
Postfix to Infix and Prefix to Infix conversion in c using stacks
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
# define MAX 20
char str[MAX],stack[MAX];
int top=-1;
void push(char c)
{
stack[++top]=c;