Skip to content

Instantly share code, notes, and snippets.

View shreyasHpandya's full-sized avatar

shreyas pandya shreyasHpandya

View GitHub Profile
@shreyasHpandya
shreyasHpandya / git-diff-x.sh
Created August 15, 2024 09:49
Git diff with all the enhanced options
alias gdx="git diff --diff-algorithm=patience --color --ws-error-highlight=all --break-rewrites --find-renames --find-copies-harder --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change"
@shreyasHpandya
shreyasHpandya / skills.md
Created March 9, 2021 12:26
List of skills required for modern software devs
Programming git OS(Linux) Networking Public cloud IAC Containers orchastration config-mgmt CI/CD olly Miscellaneous databases Web
12-factor app git workflows bash commands L3/L7 protos cloud specific concepts teraform Docker handon k8, swarm Ansible Travis/Jenkins Prometheus Big data RDBMS/SQL HTML, CSS, Ajax
OOPs branching strategy file system organisa
@shreyasHpandya
shreyasHpandya / minimal_django_service.py
Created September 6, 2017 11:04
A template to quickly write a minimalist Django based service
import sys
from django.conf import settings
from django.core.wsgi import get_wsgi_application
from django.conf.urls import url
from django.http import HttpResponse
settings.configure(DEBUG=True)
def index(request):
@shreyasHpandya
shreyasHpandya / blackjack.py
Last active August 29, 2015 14:26
blackjack simulator
import random
import sys
def pop_random(deck):
i = random.randint(0, len(deck) - 1)
return deck.pop(i)
def hand_total(hand):
@shreyasHpandya
shreyasHpandya / sublime_config.json
Last active October 22, 2019 14:07
Settings that needs to be overridden in sublime
{
"ensure_newline_at_eof_on_save": true,
"font_face": "SF Mono Regular",
"font_size": 10,
"highlight_modified_tabs": true,
"ignored_packages":
[
],
"indent_guide_options":
[
@shreyasHpandya
shreyasHpandya / pylintrc
Created July 22, 2014 09:36
for we2py projects
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
init-hook='import sys; sys.path.append("../../")'
# Profiled execution.
@shreyasHpandya
shreyasHpandya / service.js
Created March 25, 2014 14:40
A home cooked equivalent of AngularJS $resource
function service(serviceEndpoint, defaultParams){
if (defaultParams===undefined){
defaultParams = {};
}
var wrapper = function(query, success, error){
var returnObj = {};
var promise = $.ajax({
url: serviceEndpoint,
data: $.extend(query, defaultParams),

Use following to view pretty git logs

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

Create an alias for above command

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Source: https://coderwall.com/p/euwpig

@shreyasHpandya
shreyasHpandya / Art and Fear
Created July 25, 2013 07:49
inspirational fable
The ceramics teacher announced on opening day that he was dividing the class into two groups.
All those on the left side of the studio, he said, would be graded solely on the quantity of work they produced, all those on the right solely on its quality.
His procedure was simple: on the final day of class he would bring in his bathroom scales and weigh the work of the “quantity” group: 50 pounds of pots rated an “A”, 40 pounds a “B”, and so on.
Those being graded on “quality”, however, needed to produce only one pot — albeit a perfect one — to get an “A”.
Well, came grading time and a curious fact emerged: the works of highest quality were all produced by the group being graded for quantity.
It seems that while the “quantity” group was busily churning out piles of work-and learning from their mistakes — the “quality” group had sat theorizing about perfection, and in the end had little more to show for their efforts than grandiose theories and a pile of dead clay
@shreyasHpandya
shreyasHpandya / .vimrc
Last active December 11, 2015 02:08
my vimrc
filetype on
filetype plugin on
call pathogen#infect()
setl et ts=4 sw=4 softtabstop=4 autoindent
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd BufWritePre * :%s/\s\+$//e
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>