Skip to content

Instantly share code, notes, and snippets.

View mohitt's full-sized avatar
🎯
Focusing

Mohit Thakral mohitt

🎯
Focusing
View GitHub Profile
curl 'https://cottonwood.k12app.space/api/v1/companies?search=&order=asc&offset=0&limit=20' \
-H 'accept: application/json, text/javascript, */*; q=0.01' \
-H 'accept-language: en-US,en;q=0.9,hi;q=0.8' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'cookie: __cmpccpausps=1YNY; __gsas=ID=13ba056a8d144109:T=1723439440:RT=1723439440:S=ALNI_MaSMpFCR2cNzqZyqZDHVQTc9aw7Uw; __cmpcccx68884=aBQDRrXHAAwABAAoBEAAIABwALgAaABQAEEAJoAXgBDgDHAcSA9ECDIEHAUaAqIBUsAvsHWwdlg_rRfWjItGlaNm0brRv2jzaPS0fFs7LZ7Wz7toS2hVtDraJW0atwvbqNupcL0wvbo9ej2dHv0fHsoOyh-Dc4OA; snipeit_session=bGxCppzHXQZjZftusMPR8thWf1HXuqgMLgHO8yGl; companiesTable.bs.table.cardView=false; laravel_token=eyJpdiI6ImhXeXpVTnlUd0p1WTlUYmNNTUk1NVE9PSIsInZhbHVlIjoicjV2Uk5tVnpzOHhXV1M1d1lXNXhYRUFPcFBBMmdvWjhQUG1pQWUvLytHc05jZ2tHY0ZuMlEyTFlIMFV2Ukl3MEIrKzBjUGhKaWxkTjc3dDU4UFQ5OFQ5Vk11ZlVXeVNYWW1lb1g4ay9jZzRHdlAvVXZZS2hVVysyZUtwaXlyclNvTUNFaTdkZWtvN1ViSXdYUEFpVy83cDlKcUI1T1RXTWZPYkd0b0hhVFluN093Skt2Y2NVcGRtcVcvelJmalpKRXg2WHE4TGJHUDh1
# Following throws exception with sessionmaker and asyncpg connection string
inspector = inspect(engine)
return inspector.has_table(table_name, schema_name)
@mohitt
mohitt / gist:da9cc416fe43baf0d7f8305b8c4b3447
Created January 23, 2022 01:42
Exception in sql alchemy
# Session created using session maker, asyncpg connection string
engine = self.active_session.get_bind()
table_name = model_class.__tablename__
schema_name = model_class.__table_args__["schema"]
return await engine.dialect.has_table(
self.active_session, table_name, schema_name
)
@mohitt
mohitt / .zshrc
Created October 9, 2021 05:56
zsh history configuration
export HISTFILE=~/.zsh_history
export HISTFILESIZE=1000000000
export HISTSIZE=1000000000
setopt INC_APPEND_HISTORY
export HISTTIMEFORMAT="[%F %T] "
setopt EXTENDED_HISTORY
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
@mohitt
mohitt / ideavimrc
Created October 29, 2020 01:50
TempFile
let mapleader=" "
nnoremap <Leader>ve :e ~/.ideavimrc<CR>
nnoremap <Leader>vl :source ~/.ideavimrc<CR>
@mohitt
mohitt / HomeKeysOnMac.md
Created July 11, 2020 16:47
Home keys mapping mac

https://damieng.com/blog/2015/04/24/make-home-end-keys-behave-like-windows-on-mac-os-x

If, like me, you want Home to send you to the start of the line and not to the top of the document then create a file called DefaultKeyBinding.dict in your ~/Library/KeyBindings folder (might need to create that folder too) with the following contents:

{
  "\UF729"  = moveToBeginningOfParagraph:; // home
  "\UF72B"  = moveToEndOfParagraph:; // end
 "$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
https://codesandbox.io/s/4lr7oxxrl7?file=/src/Hello.js:311-321
@mohitt
mohitt / setup-windows.ps1
Created February 25, 2020 21:14
Setting up windows
choco install -y vsvim
choco install -y resharper
choco install -y vscode
choco install -y jetbrains-resharper
choco install -y golang
# restart terminal
go get github.com/pcarrier/gauth
# get the gauth.csv file from .config folder to copy paste
choco install -y microsoft-windows-terminal
@mohitt
mohitt / _vsvimrc-resharper
Last active February 14, 2020 03:06
_vsvimrc_resharper
let mapleader="\<space>"
set clipboard=unnamed
nnoremap <leader>j :vsc Window.PreviousTab<CR>
nnoremap <leader>k :vsc Window.NextTab<CR>
nnoremap <leader>r :vsc Resharper.Resharper_GotoRecentFiles<CR>
nnoremap <leader>e :vsc Resharper.Resharper_GotoType<CR>
nnoremap <leader>f :vsc Resharper.Resharper_GotoFile<CR>
nnoremap <leader>d :vsc File.Close<CR>
@mohitt
mohitt / command.pwsh
Created January 8, 2020 21:51
Get process id for port
Get-Process -Id (Get-NetTCPConnection -LocalPort 5050).OwningProcess