Skip to content

Instantly share code, notes, and snippets.

@sajinct
sajinct / savetocookie.cs
Created December 30, 2013 13:28
Save Object To Cookie
string myObjectJson = new JavaScriptSerializer().Serialize(myObject);
var cookie = new HttpCookie("myObjectKey", myObjectJson)
{
Expires = DateTime.Now.AddYears(1)
};
HttpContext.Response.Cookies.Add(cookie);
Verifying my Blockstack ID is secured with the address 1N4tY8YoaF8TePXtyvUTLvwbUMdgqwqzmr https://explorer.blockstack.org/address/1N4tY8YoaF8TePXtyvUTLvwbUMdgqwqzmr
@sajinct
sajinct / latency.txt
Created October 11, 2023 16:14 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD

Creating an SSL certificate for a domain using Let's Encrypt on Ubuntu is a straightforward process. Here’s how you can do it:

Prerequisites

  1. A registered domain name: Ensure that you have a domain name pointed to your server’s IP address.
  2. Ubuntu server: Make sure your server is running and you have SSH access.
  3. Web server: You should have a web server like Apache or Nginx installed.

Step 1: Install Certbot

First, update your package index and install Certbot:

Sure! Here’s the content converted to Markdown format:

# Install Certbot in Ubuntu 20.04

Instead of the older `python-certbot-apache` package, Certbot now recommends using the `snapd` package manager to install Certbot in Ubuntu. InMotion Cloud Server Hosting is incompatible with `snapd` at this time, but Python Installs Packages (PIP) works just as well.

## Install Certbot in Ubuntu with PIP

Cloud server users can install Certbot in Ubuntu with PIP.
@sajinct
sajinct / Grade_Entity.md
Created November 11, 2024 11:37
Grade and Entity in HRMS

In the context of HR Management System (HRMS) software, the terms "grade" and "entity" typically refer to elements of the organizational structure, hierarchy, and employee management that the system tracks and organizes. Here's an explanation of each:

1. Grade in HRMS:

"Grade" refers to an employee's classification within an organization's hierarchical structure, often related to their job level, position, or salary band. It typically represents a specific step or rank within an organizational hierarchy and is often linked to compensation, responsibilities, and promotion criteria.

  • Purpose: Grades are used to define a clear structure for the organization's workforce and help HR departments manage employee roles, salaries, career paths, and promotions.

  • Examples:

    • Job Grades: An organization might have several grades (Grade 1, Grade 2, Grade 3, etc.), where each grade represents increasing levels of responsibility and compensation. For example:
  • Grade

@sajinct
sajinct / datagrid_options.md
Last active March 20, 2025 11:34
Grid Options for Angular and React Applications

Technical Document: Grid Options for Angular and React Applications

Introduction

This document provides an overview of JavaScript grid libraries suitable for Angular and React applications. The options are categorized into open-source and paid solutions, along with their key features, framework support, and recommendations. The goal is to help the team select the most suitable grid library based on project requirements, framework (Angular or React), budget, and feature needs.


1. Open-Source Grid Libraries

1.1 AG Grid Community

@sajinct
sajinct / kiosk_printing.md
Created October 28, 2025 03:25
Kiosk Mode Silent Printing Guide:- Simple steps to run Chrome, Firefox, and Edge in full-screen kiosk mode and print without dialogs. Uses shortcuts and built-in flags. Prints to default printer. Great for kiosks, receipts, or tickets.

Overview

Kiosk mode in web browsers is designed for locked-down environments like public terminals, where the browser runs in full-screen with limited navigation. Silent printing (bypassing the print dialog) is often tied to this mode and prints directly to the default printer. This is useful for applications like POS systems, ticketing kiosks, or automated receipt printing. Below, I outline the setup for Google Chrome, Mozilla Firefox, and Microsoft Edge (Chromium-based) as of October 2025. These methods use command-line flags or configuration tweaks. Note: Always test on your target OS (e.g., Windows), and ensure the default printer is set correctly, as these features print to it without prompts.

Browser Kiosk Mode Command/Flag Silent Printing Method Key Notes
Google Chrome --kiosk [URL] (e.g., chrome.exe --kiosk https://example.com) Add --kiosk-printing to the command line Works in full