Skip to content

Instantly share code, notes, and snippets.

View rhythmize's full-sized avatar

Rhythm Chopra rhythmize

  • Microsoft
  • Prague, Czech Republic
View GitHub Profile
@rhythmize
rhythmize / Linux bash tricks.md
Last active July 26, 2024 15:43
Linux bash tricks

Shorten cwd in bash and show git branch, if cwd is git repo

parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

PS1='\[\033[01;34m\]\W\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
@rhythmize
rhythmize / Flasgger Test
Created May 25, 2018 13:26
Sample test for Flasgger to send data in formBody of GET request
from flask import Flask, request
from flasgger import Swagger
app = Flask(__name__)
Swagger(app)
@app.route('/')
def main_route():
"""
Test Endpoint
import gi
gi.require_version('Gst','1.0')
gi.require_version('GstVideo','1.0')
gi.require_version('GstRtspServer','1.0')
from gi.repository import Gst, GObject, GstRtspServer, GstRtsp
Gst.debug_set_active(True)
Gst.debug_set_default_threshold(3)