Skip to content

Instantly share code, notes, and snippets.

@KrutNA
KrutNA / build.gradle.kts
Created August 10, 2023 12:06
Jooq generation with TC and Flyway migrations
import org.testcontainers.containers.PostgreSQLContainer
plugins {
java
id("org.springframework.boot") version "3.1.2"
id("io.spring.dependency-management") version "1.1.2"
id("org.flywaydb.flyway") version "9.7.0"
id("nu.studer.jooq") version "8.2"
}
@KrutNA
KrutNA / send_other_socket.c
Last active July 17, 2023 07:40
C RCE template to send any information from remote host directly over socket
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
int init_connection(char *host, char *port);
int main(int argc, char *argv[]) {
char *address = argv[1];
@KrutNA
KrutNA / chain-arguments.js
Created July 4, 2022 13:09
Create object with chaining from specified map of functions.
class Result {
constructor(functions, state) {
this.state = state;
for (const func_name of Object.keys(functions)) {
let func = functions[func_name];
this[func_name] = function(...args) {
this.state = func.apply(this, [this.state].concat(args));
return this;
}
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <array>
#include <optional>
@KrutNA
KrutNA / fizzbuzz-template-compile-time.cpp
Last active September 17, 2021 19:33
C++20 implementation of FizzBuzz. Compile-time, templates. No loops, ifs and others.
#include <iostream>
const long FIZZ_NUM = 3;
const long BUZZ_NUM = 5;
constexpr const char *FIZZ = "FIZZ";
constexpr const char *BUZZ = "BUZZ";
constexpr const char *FIZZ_BUZZ = "FIZZBUZZ";
namespace detail
@KrutNA
KrutNA / Lab 1
Last active February 5, 2018 23:04
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CS_Lab_1
{
class MusicList