Skip to content

Instantly share code, notes, and snippets.

@singhsays
singhsays / .vimrc
Created November 18, 2023 01:05
vimrc
" v1.0
"Misc
highlight LineTooLong cterm=bold ctermfg=white ctermbg=red guibg=LightYellow
match LineTooLong /\%>80v.\+/
"Keymaps
cmap w!! w !sudo tee % >/dev/null
nmap <silent> ,/ :nohlsearch<CR>
nnoremap <F2> :set invpaste paste?<CR>
@singhsays
singhsays / server.go
Created March 13, 2023 06:41
Basic golang http server with graceful shutdown
package main
import (
"context"
"flag"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/vega.js"></script>
</head>
<body>
a.1 = a
a.0 = 0
a+1 = 1
a+0 = a
a^1 = ā
a^0 = a
~-a = a-1
-a = ~a+1 // Two's complement
@singhsays
singhsays / package.json
Created September 13, 2016 11:02
Packages to install
{
"homebrew":["mongodb", "git"],
"homebrew-cask": ["google-chrome", "google-drive"],
"mas": []
}