Skip to content

Instantly share code, notes, and snippets.

View shravanasati's full-sized avatar
🎯
Learning

Shravan Asati shravanasati

🎯
Learning
View GitHub Profile
@shravanasati
shravanasati / VS Code Extensions.md
Last active December 20, 2021 11:03
All VS Code extensions I've installed.

VS Code Extensions

  • Python
  • Pylance
  • Go
  • Code Runner
  • Code Time
  • Dracula Official
  • Material Icon Theme
  • Advanced New File
@shravanasati
shravanasati / settings.json
Last active June 10, 2021 15:39
VS Code Settings
{
"workbench.iconTheme": "material-icon-theme",
"editor.mouseWheelZoom": true,
"files.autoSave": "afterDelay",
"editor.fontSize": 20,
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
@shravanasati
shravanasati / init.vim
Last active May 8, 2021 10:32
Neovim configuration file.
" Specify a directory for plugins
:set clipboard+=unnamed
call plug#begin('~/.vim/plugged')
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
@shravanasati
shravanasati / python.json
Created April 27, 2021 07:21
My VS Code user snippets for python.
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@shravanasati
shravanasati / 69.py
Created June 27, 2021 10:16
A python script which creates a 69 using turtle.
import turtle, random
from math import *
t = turtle.Turtle()
turtle.bgcolor("black")
t.speed(3000000)
t.pensize(5)
@shravanasati
shravanasati / v_updater.py
Last active March 29, 2023 18:32
V updater/installer script written in python.
"""
Cross platform script for installing and updating V toolchain.
Requirements:
pip install requests tqdm userpath
"""
import os # to do a lot of things
import platform # to determine host os
@shravanasati
shravanasati / !concurrency
Last active August 9, 2021 06:08
Two implementations of syncing all goroutines in go -> using waitgroups and channels.
This gist shows two examples of how to make all goroutines finish in a Go program. There are two implementations mentioned here:
1. Using channels
2. Using goroutines
@shravanasati
shravanasati / release_downloads.py
Last active July 3, 2023 09:25
A python script to fetch the github release download count for a repo.
"""
Demo:
Github username: Shravan-1908
Repo name: hydra
Release ID: (latest)
Download stats for `Shravan-1908/hydra`, release `v2.2.0`
---------------------------------------------------------
hydra-darwin-amd64: 2
@shravanasati
shravanasati / gobuild.py
Last active August 16, 2021 10:22
A python script to cross compile go executables parallely.
import subprocess
import os
from multiprocessing import Process
from typing import List
def build(appname:str, platform: str) -> None:
try:
goos = platform.split("/")[0]
goarch = platform.split("/")[1]
@shravanasati
shravanasati / .\wallpaper_pusher.py
Last active September 9, 2021 11:24
A simple python script to sync the wallpapers in the ~/.iris/wallpapers dir with a remote repo.
import subprocess
import os
from pathlib import Path
from typing import List
from datetime import datetime
import sys
import shlex
def run(command: str) -> None: