Skip to content

Instantly share code, notes, and snippets.

View lalitmee's full-sized avatar
👨‍💻
Unmarshalling

Lalit Kumar lalitmee

👨‍💻
Unmarshalling
View GitHub Profile
@bashbunni
bashbunni / .zshrc
Created January 4, 2023 16:28
CLI Pomodoro for Linux
# study stream aliases
# Requires https://github.com/caarlos0/timer to be installed. spd-say should ship with your distro
declare -A pomo_options
pomo_options["work"]="45"
pomo_options["break"]="10"
pomodoro () {
if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then
val=$1
@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 18, 2024 18:07
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@spamwax
spamwax / bubbles.lua
Created July 26, 2021 22:57
galaxyline theme
--[[
-- To get the icons working correctly:
-- 1. Install nonicons.ttf from https://github.com/yamatsum/nonicons
-- 2. Install nvim plugin https://github.com/yamatsum/nvim-nonicons
--]]
local gl = require("galaxyline")
local gls = gl.section
local fileinfo = require('galaxyline.provider_fileinfo')
local iconz = require("nvim-nonicons")
@folke
folke / lua-lsp.lua
Last active March 7, 2023 19:17
Correct sumneko lua lsp setup for init.lua and plugin development
-- put this file somewhere in your nvim config, like: ~/.config/nvim/lua/config/lua-lsp.lua
-- usage: require'lspconfig'.sumneko_lua.setup(require("config.lua-lsp"))
local library = {}
local path = vim.split(package.path, ";")
-- this is the ONLY correct way to setup your path
table.insert(path, "lua/?.lua")
table.insert(path, "lua/?/init.lua")
@romainl
romainl / diff.md
Last active June 21, 2022 07:43
:DiffOrig but smarter

:DiffOrig but smarter

This is an enhanced version of the snippet provided under :help diff-original-file.

Where the original :DiffOrig only shows differences between the buffer in memory and the file on disk, :Diff can be used in two ways:

  • against the file on disk, like the original, with:

    :Diff
    
@romainl
romainl / sort.vim
Created December 31, 2018 10:30
Sort operator
function! Sort(type, ...)
'[,']sort
endfunction
nmap <silent> <key> :set opfunc=Sort<CR>g@
" usage:
" <key>ip
" <key>G
@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active May 13, 2024 07:35
Configuring Emacs for react, es6, and flow

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.

@romainl
romainl / tags.md
Last active March 25, 2022 07:00
Tags

Tags

Setup

Tell Vim to look for tags files:

  • in the directory of the current file,
  • in the working directory,
  • and in every parent directory, recursively,
@romainl
romainl / multivide.vim
Last active September 17, 2023 10:11
Multiply/divide by [count]
function! Multivide(divide)
let cnt = v:count1
let old_reg = getreg("v")
call search('\d\([^0-9\.]\|$\)', 'cW')
normal v
call search('\(^\|[^0-9\.]\d\)', 'becW')
normal "vygv
if a:divide == 1
execute 'normal "_c' . @v / cnt
else
@mnsami
mnsami / download_egghead_videos.sh
Last active August 4, 2022 06:27
this script is to download egghead videos using youtube-dl
#!/bin/bash
usage() { echo "usage: --coursename [--coursename \"build-a-react-app-with-redux\"] --type [--type \"courses|lessons\"]" 1>&2; exit 1; }
OPTS=$(getopt -o c:t: --long coursename:,type: -n 'download_egghead_videos.sh' -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$OPTS"