Skip to content

Instantly share code, notes, and snippets.

View ujjwal-kr's full-sized avatar
:shipit:
Explo[ r | it ]ing

Ujjwal Kumar ujjwal-kr

:shipit:
Explo[ r | it ]ing
View GitHub Profile
#include <iostream>
#include <unordered_map>
#include <string>
#include <algorithm>
void get_label(std::unordered_map<std::string, size_t> map, int pc) {
std::vector<std::size_t> label_point_vec = {};
std::vector<std::string> key_vec = {};
for (const auto &pair : map) {
use std::collections::HashMap;
use std::io::prelude::*;
use std::{env, f64, fs, io, path::Path, process};
mod funcs;
mod tests;
use funcs::{errors, operations, print, stack, stdfn, var};
#[derive(Clone)]
pub struct Vars {
@ujjwal-kr
ujjwal-kr / sym.js
Created December 22, 2021 00:48
Symmetric difference between n number of sets
function sym() {
let sets = []
let calculated
for (let i = 0; i < arguments.length; i++) {
sets.push(arguments[i])
}
for (let i = 0; i < sets.length; i = i + 2) {
if (!calculated) {
let char = []
for (let j = 0; j < sets[i].length; j++) {
@ujjwal-kr
ujjwal-kr / rev.c
Last active December 4, 2021 11:02
REV
void _ZN4core3ptr116drop_in_place$LT$core..future..from_generator..GenFuture$LT$sussy_malware..main..$u7b$$u7b$closure$u7d$$u7d$$GT$$GT$17hf1a31799a84a7582E.llvm.11713022222054205904
(int64_t arg1)
{
int64_t *piVar1;
int64_t iVar2;
int64_t iVar3;
int64_t iVar4;
int64_t iVar5;
undefined8 *puVar6;

Keybase proof

I hereby claim:

  • I am ujjwal-kr on github.
  • I am epicujjwal (https://keybase.io/epicujjwal) on keybase.
  • I have a public key ASBwsammcIOeeW7AnYCXY8nIBN7xdWQLBYh-kDeagHWQkgo

To claim this, I am signing this object:

@ujjwal-kr
ujjwal-kr / byte_to_str.go
Created October 29, 2020 12:10
Convert []byte to string in Golang
func BytesToString(data []byte) string {
return string(data[:])
}
@ujjwal-kr
ujjwal-kr / app.go
Created October 20, 2020 16:42 — forked from henkman/app.go
webapp example with fiber + jwt-go +gorm + scrypt
package main
import (
"bytes"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"fmt"
"io"
"regexp"
import { Injectable, NestMiddleware, HttpException, HttpStatus } from '@nestjs/common';
import { Request, Response } from 'express';
import * as jwt from 'jsonwebtoken';
import { KEY } from 'src/secret/secret';
@Injectable()
export class AdminMiddleware implements NestMiddleware {
use(req: Request, res: Response, next: () => void): void {
const token = req.headers.authorization;
const decoded: any = jwt.verify(token, KEY);
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import click
from PIL import Image
class Steganography(object):