Skip to content

Instantly share code, notes, and snippets.

@Varun-garg
Varun-garg / ObjectDumper.cs
Created June 14, 2023 07:18
object dumper c#
using System;
using System.Collections;
using System.Linq;
using System.Reflection;
using System.Text;
public class ObjectDumper
{
private readonly int indentSize;
private readonly List<int> hashListOfFoundElements;
@Varun-garg
Varun-garg / server.rb
Created September 30, 2021 07:47
small key value store
require 'sinatra'
require 'json'
class Value
attr_accessor :type, :value
def initialize(value)
@value = value
if ['true', 'false'].include? value.downcase
@Varun-garg
Varun-garg / atset3_keybinds.json
Created September 4, 2021 16:04
atset3 key bindings - numeric values are those defined by the AT keyboard controller, set 3 (PS/2 compatible).
{
"KEY_F1": "7 (0x7)",
"KEY_ESC": "8 (0x8)",
"KEY_HELP": "9 (0x9)",
"KEY_STOP": "10 (0xa)",
"KEY_AGAIN": "11 (0xb)",
"KEY_PROPS": "12 (0xc)",
"KEY_TAB": "13 (0xd)",
"KEY_GRAVE": "14 (0xe)",
"KEY_F2": "15 (0xf)",
@Varun-garg
Varun-garg / slack_status
Last active December 27, 2021 07:26
slack status updater
#!/usr/bin/ruby
require 'net/http'
require 'optparse'
require 'json'
require 'date'
API_TOKEN = ENV['SLACK_TOKEN']
OPTS = Hash[ ARGV.join(' ').scan(/--?([^=\s]+)(?: (\S+))?/) ] # regex to arrange args in hash
@Varun-garg
Varun-garg / request_race.js
Created March 18, 2019 06:47
Got no race condition in ticks_race.js, but got in request_eace.js
/* eslint-disable strict */
const http = require('http')
const https = require('https')
const assert = require('assert')
const port = 9000
let global_start = null;
data:image/jpeg;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAZ0AAAKYCAYAAACo+iWMAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AACAASURBVHic7L1ZkyXHfbf3ZNZ+9l5nejYMFoIgSIC0uIiSXlAkLVthh2/1PXztD+Brfws7Qrf2GyGHJCJMSi9JkSKAIQkMlgF6MFvvfZbac/HFOVV9egCQg60HDeQT0dF9zqmqzKo8nb/8L5kprLUWh8PhcDjOAPm4K+BwOByOrw5OdBwOh8NxZjjRcTgcDseZ4UTH4XA4HGeGEx2Hw+FwnBlOdBwOh8NxZvif58Wn0ynb29vs7+9zfHxMnufkeY5S6vMs1uFwOByPgO/7JElCkiSMRiPW19d54okn6Pf7n1uZ4vOYp/Paa6/xxhtvUNc1W1tbXLhwgTAMieOYOI7x/c9V6xwOh8PxCCilKIqCoiioqoqdnR3u3btHGIY899xzvPjii595mZ+p6Ny4cYNf/vKXfOc732FjY4PhcPhZXdrhcDgcZ8R4PGZvb49XX32VH/7wh3zrW9/6zK79mYjOwcEBL7/8Mqurq7z44otI6UJFDofDcd7RWvPaa69xdHTET3/6U1ZWVj71NT+16Lz11lv87ne/40c/+hFRFH3qCjkcDofji0VZlrz88st873vf45lnnvlU1/pUonPjxg3u3bvHD37wg09VCYfD4XB88fnVr37F1atX+eY3v/mJr/GJRee1115jd3eX7373u5+4cIfD4XCcL37zm9+wtbX1ieM8nyj48tZbb3H//n0nOA6Hw/EV43vf+x537tzh7bff/kTnf2zROTg44He/+51zqTkcDsdXlL/8y7/kN7/5DUdHRx/73I8tOj/72c/40Y9+9LELcjgcDseXh7/927/lZz/72cc+72OJzo0bN1hfX3dZag6Hw/EVJ45jRqMRv//97z/WeR9LdH75y1/
Test