Skip to content

Instantly share code, notes, and snippets.

View stonecharioteer's full-sized avatar

Vinay Keerthi stonecharioteer

View GitHub Profile
@stonecharioteer
stonecharioteer / README-jq-fzf-REPL.md
Last active September 20, 2022 07:50 — forked from reegnz/README.md
Implementing a jq REPL with fzf

Implementing a jq REPL with fzf

Update: I created jq-zsh-plugin that does this.

One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).

Another one of my favourite tools is fzf.

@stonecharioteer
stonecharioteer / clean-docker.sh
Created March 3, 2022 04:43 — forked from buckett/clean-docker.sh
Cleans out old docker images and containers.
#!/bin/bash
# Clean all exited containers
docker ps -qaf status=exited | xargs docker rm
# Remove all unused images
docker images -f dangling=true -q | xargs docker rmi
@stonecharioteer
stonecharioteer / profiler
Created January 6, 2022 12:13 — forked from disusered/profiler
Profiling Neovim startup
#!/bin/bash
iterations=10
# -----------------------------------------------------------------------------
# Create array of results
declare -a results
for i in $(seq 1 $iterations);
git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
@stonecharioteer
stonecharioteer / flask_profiler.py
Created July 14, 2020 13:07 — forked from shreyansb/flask_profiler.py
A profiler for Flask apps
"""
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the profile or cProfile
module to do the profiling and writes the stats to the stream provided
To use, run `flask_profiler.py` instead of `app.py`
see: http://werkzeug.pocoo.org/docs/0.9/contrib/profiler/
and: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvi-debugging-testing-and-profiling
"""
@stonecharioteer
stonecharioteer / app.py
Created December 3, 2018 10:26 — forked from jtpio/app.py
Dash URL State example
import dash
import dash_core_components as dcc
import dash_html_components as html
from urllib.parse import urlparse, parse_qsl, urlencode
from dash.dependencies import Input, Output
app = dash.Dash()
app.config.suppress_callback_exceptions = True
@stonecharioteer
stonecharioteer / how-to-pdf-sphinx.txt
Last active August 28, 2018 07:30 — forked from alfredodeza/how-to.txt
pdf output from sphinx with rst2pdf
1. Install rst2pdf
- use your package manager (or)
- pip install rst2pdf (or)
- easy_install rst2pdf
2. Add rst2pdf to the list of extensions in conf.py
extensions = ['rst2pdf.pdfbuilder']
@stonecharioteer
stonecharioteer / pytest.md
Created July 18, 2018 12:05 — forked from kwmiebach/pytest.md
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@stonecharioteer
stonecharioteer / balloontip.py
Created February 13, 2018 07:11 — forked from wontoncc/balloontip.py
Balloon tip module, Python, using win32gui.
# -- coding: utf-8 --
from win32api import *
from win32gui import *
import win32con
import sys, os
import struct
import time
class WindowsBalloonTip: