Skip to content

Instantly share code, notes, and snippets.

package skiplist
import (
// "encoding/json"
// "fmt"
"math/rand"
"time"
)
const epsilon float64 = 0.0001
@amitavaghosh1
amitavaghosh1 / base.mapping.vim
Last active April 12, 2023 05:41
init.lua for neovim 0.8+, with packer and treesitter and lsp (autocomplete)
let g:python3_host_prog = '/usr/bin/python3'
let g:python_host_prog = '/usr/bin/python3'
let g:node_host_prog = '/Users/amitava.ghosh/.nvm/versions/node/v17.1.0/bin/node'
" Required:
filetype plugin indent on
"*****************************************************************************
@amitavaghosh1
amitavaghosh1 / encoder.go
Last active October 27, 2022 10:58
Encoder. Change \r to \n. Fucking microsoft
package encoder
import (
"io"
"io/ioutil"
"mime/multipart"
"github.com/dimchansky/utfbom"
"github.com/sirupsen/logrus"
"golang.org/x/net/html/charset"
# Source: https://gist.github.com/17f57ba2a076bcd5335424575f55d6bd
##########################################################
# How to do database schema migration inside Kubernetes? #
# https://youtu.be/SofQxb4CDQQ #
##########################################################
# Referenced videos:
# - K3d - How to run Kubernetes cluster locally using Rancher k3s: https://youtu.be/mCesuGk-Fks
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4
@amitavaghosh1
amitavaghosh1 / blog_gobar.md
Created August 24, 2022 14:12
Finding channels

I was remodelling the whole worker consumer situation in the notification service. It's a thought experiment, based on what I have learned, and am still struggling to.

But this seems definitely a better way to reason about it. The code is attached below. A generic representation

There are three files in this pattern:

  • _producer.go
  • _producer_consumer.go
  • _consumer.go
@amitavaghosh1
amitavaghosh1 / .tmux.conf
Last active August 8, 2022 07:20
ECS Remote Necessary installs
unbind C-b
set -g prefix C-z
bind C-z send-prefix
bind-key C-z last-window
set -g default-terminal "screen-256color"
set -g aggressive-resize on
set -g base-index 1
set -g mouse on
function camelcase
perl -pe 's#(_|^)(.)#\u$2#g'
end
function snakecase
perl -pe 's#([A-Z])#_\L$1#g' | perl -pe 's#^_##'
end
package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
)
func penik(err interface{}) {
@amitavaghosh1
amitavaghosh1 / gist:b57ac2b32a7f8e48cdca61a46833d474
Created January 7, 2022 09:27 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@amitavaghosh1
amitavaghosh1 / dummy-web-server.py
Created July 22, 2021 04:04 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request: