Skip to content

Instantly share code, notes, and snippets.

View sayanarijit's full-sized avatar

Arijit Basu sayanarijit

View GitHub Profile
@sayanarijit
sayanarijit / shell.nix
Created February 10, 2024 08:12
Rust shell.nix
with import <nixpkgs-unstable> { };
pkgs.mkShell {
buildInputs = with pkgs; [
cargo
rustc
gcc
gnumake
rustfmt
rust-analyzer
clippy
@sayanarijit
sayanarijit / HttpStatusCode.ts
Created March 4, 2022 02:49 — forked from scokmen/HttpStatusCode.ts
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body

Keybase proof

I hereby claim:

  • I am sayanarijit on github.
  • I am sayanarijit (https://keybase.io/sayanarijit) on keybase.
  • I have a public key ASBLw7LpxU4kSCUZe2Ari3dNuh8BSX8yLqDoe5nP35R3HAo

To claim this, I am signing this object:

-- Credits:
-- https://gist.github.com/bofm/70766566ecd4edee76f8f17ffa7362c9
-- https://stackoverflow.com/questions/21649967/lua-equivalent-of-python-repr
local data = {}
local function noop(...)
return ...
end
@sayanarijit
sayanarijit / intro.md
Created February 15, 2021 09:02
Linux Introduction

Introduction

  • Linux is only a kernel (collection of drivers, task schedulers etc).
  • Red Hat, Fedora, Ubuntu, Manjaro, Kali, NixOS etc. are OS distributions (uses the Linux kernel).
  • Linux OSes can be used via CLI (suitable for servers) or GUI (suitable for personal laptops/desktops).
  • Linux CLI
    • sh
    • bash
    • csh
  • ksh
@sayanarijit
sayanarijit / Cargo.toml
Last active June 16, 2020 15:47
Rocket in a gist
[package]
name = "rocker_app"
version = "0.1.0"
authors = ["Arijit Basu <sayanarijit@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rocket = "0.4.5"
@sayanarijit
sayanarijit / 0. pipechat.sh
Last active December 23, 2018 18:30
Going Crazy With UNIX Pipes
#!/bin/bash
send() {
[ "$(cat /tmp/pipelock)" == "1" ] && return 0
echo 1 > /tmp/pipelock
read -p "me ['q' to quit] : " msg
[ $msg == q ] && echo 0 > /tmp/pipelock && echo q > ~/mypipe && return 1
echo $msg > ~/mypipe
echo 0 > /tmp/pipelock
return 0