Skip to content

Instantly share code, notes, and snippets.

View nvarun's full-sized avatar
:electron:
I may be slow to respond.

Varun Nischal nvarun

:electron:
I may be slow to respond.
View GitHub Profile
import re, sys, string, os
###----------------------------------------------------------------------
## Define Function(s)
###----------------------------------------------------------------------
def fn__applyStyle(lineOfCode):
indexZero = lineOfCode[0]
import re, sys, string, os
###----------------------------------------------------------------------
## Define Function(s)
###----------------------------------------------------------------------
def fn__applyStyle(lineOfCode):
indexZero = lineOfCode[0]
alias gbr='git branch'
alias gco='git checkout'
alias gci='git commit'
alias gcm='git checkout master'
alias glo='git log --oneline'
alias gst='git status'
#!/bin/ksh
##DESC======================================================================
### Extracts block of code/section based on two arguments;
### 1 - Source Code File, or Git Diff Output
### 2 - Extract Pattern
##======================================================================
function fn__extrt_block {
test $# -ne 2 && exit 1
def fn__jobDefnToDict(iputFile):
jobDict = {}
with open(iputFile, 'r') as fname:
for line in fname.read().splitlines():
colon = string.find(line, ':')
@nvarun
nvarun / df2json
Last active August 29, 2015 13:57
[Fedora 20] Converting File having pipe-delimited values into JSON
#!/bin/ksh
test $# -lt 1 || test $# -gt 2 || test ! -f $1 && exit 1
cp $1 $1.o
echo -e "\t\"${2:-feeds}\": {"
while IFS='|' read iputKey iputRecord
do
echo -e "\t\t\"${iputKey}\": ["