Skip to content

Instantly share code, notes, and snippets.

View kriznaraj's full-sized avatar

Krishnaraj Venkatesan kriznaraj

View GitHub Profile

Multiple GitHub accounts (Work vs Personal)

This setup uses some tricks to ensure that the right email/name/ssh-key is used for the right repos without having to think about it ever again.

  • First generate two SSH keys, ~/.ssh/id_ed25519 and ~/.ssh/id_ed25519_work
  • Add one key to your personal account and the other to your work account

.ssh/config

@kriznaraj
kriznaraj / mysql-load-payment.py
Created July 21, 2023 12:47
Load dummy payments into payments table
import mysql.connector
import random
import string
# MySQL connection settings
host = ''
user = ''
password = ''
database = ''
@kriznaraj
kriznaraj / main.go
Created June 4, 2023 18:45
An optimum thread alloacation
package main
import (
"fmt"
"math"
"strconv"
"sync"
"sync/atomic"
"time"
)
using System;
using System.Collections.Generic;
using System.Linq;
namespace PasswordCracker
{
public class TrieNode
{
public IDictionary<char, TrieNode> keys;
public bool end;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
namespace KingdomDivision
{
class Edge
{
public int start;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
namespace coinchange
{
struct DpEntry
{
@kriznaraj
kriznaraj / k-th-element-two-sorted-arrays.cs
Created July 10, 2017 20:25
K-th Element of Two Sorted Arrays
using System;
using System.Collections.Generic;
namespace prob
{
class Program
{
static void Main(string[] args)
{
//Test input