Skip to content

Instantly share code, notes, and snippets.

View abhishekmurthy's full-sized avatar

Abhishek B S abhishekmurthy

View GitHub Profile
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
import pyaudio
import wave
import subprocess, shlex
import os
import json
import re
import urllib
CHUNK = 1024
FORMAT = pyaudio.paInt16
set encoding=utf-8
" tab stuff
set tabstop=4 " tab = 4
set shiftwidth=4 " indentation width
set softtabstop=4 " makes spaces feel like tabs
set expandtab " inserts softtabstop number of spaces
autocmd FileType make setlocal noexpandtab " make files must use tabs
" search stuff
set hlsearch " highlight the text matching the search pattern
@abhishekmurthy
abhishekmurthy / Upscale_yuv.c
Last active August 6, 2020 05:54
Upscaling a YUV image using Bilinear or Nearest scale algorithms
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
typedef unsigned char uint8_t;
/**
* @param src input nv12 raw data array
@abhishekmurthy
abhishekmurthy / speech.py
Created December 11, 2013 07:17
Google speech API in python
# based on http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/
# needs pyaudio package <apt-get install python-pyaudio>
# sox commands to convert from way to flac format <apt-get install sox>
import pyaudio
import wave
import subprocess, shlex
import os
CHUNK = 1024
@abhishekmurthy
abhishekmurthy / .git-completion.sh
Last active December 14, 2015 20:18
Git branch display in terminal
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@abhishekmurthy
abhishekmurthy / Custom_bash
Last active January 26, 2016 09:09
Custom bashrc
# my custom .bashrc scripts
# mkcd -- makes life simpler
function mkcd() {
mkdir $1;
cd $1;
}
## a quick way to get out of current directory ##
alias ..="cd ..";
@abhishekmurthy
abhishekmurthy / Script
Created January 4, 2013 10:03
Script to create nested directories for IS department
#!/bin/bash
for (( i=1; i<=13; i++ ))
do
mkdir lab_$i 2> /dev/null
cd lab_$i
for ((j=1; j<=100; j++))
do
if test $j -lt 10
then
mkdir 1PI09IS00$j