Skip to content

Instantly share code, notes, and snippets.

View Protino's full-sized avatar
🎯
Focusing

Gurupad Mamadapur Protino

🎯
Focusing
View GitHub Profile
@Protino
Protino / .bash_profile
Last active March 19, 2020 04:10
Aliases
#git
alias git-stats="git log --shortstat --pretty="%cE" | sed 's/\(.*\)@.*/\1/' | grep -v "^$" | awk 'BEGIN { line=""; } !/^ / { if (line=="" || !match(line, $0)) {line = $0 "," line }} /^ / { print line " # " $0; line=""}' | sort | sed -E 's/# //;s/ files? changed,//;s/([0-9]+) ([0-9]+ deletion)/\1 0 insertions\(+\), \2/;s/\(\+\)$/\(\+\), 0 deletions\(-\)/;s/insertions?\(\+\), //;s/ deletions?\(-\)//' | awk 'BEGIN {name=""; files=0; insertions=0; deletions=0;} {if ($1 != name && name != "") { print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net"; files=0; insertions=0; deletions=0; name=$1; } name=$1; files+=$2; insertions+=$3; deletions+=$4} END {print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net";}'"
#adb aliases
alias adbip="adb shell netcfg | grep wlan0 | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b'"
alias adbtext="adb shell input text"
alias adbproxy="adb sh
@Protino
Protino / .gitconfig
Created May 5, 2018 05:23
Mui Config
[alias]
st = status
ci = commit
lg = log --graph --date=relative --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ad)%Creset'
oops = commit --amend --no-edit
lgn = lg = log --graph --date=relative --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ad)%Creset' --name-only
chk = checkout
fame = python -m gitfame
import java.util.List;
public class MainActivity extends Activity implements LoaderManager.LoaderCallbacks<Cursor>{
public List<String> favoriteMovies;
public RecyclerView.Adapter myAdapter;
protected void onResume() {
//initialize your loader
getSupportLoaderManager().initLoader(LOADER_ID, null, this);
from random import randint as r
import plotly.graph_objs as go
import time,math
import numpy as np
import plotly
def pigeon_hole(s):
a = [[], [], []]
sum_a = [0, 0, 0]
for x in s:
@Protino
Protino / chess_engine_debug_helper.py
Created October 17, 2016 11:46
It is a helper file to inspect chess__engine problem from hackerrank :)
def read_file(filename):
content = [line.strip('\n') for line in open(filename)]
return content
input_cases = read_file(input('Enter input_cases file name : ',))
expected_output = read_file(input('Expected output_cases file name : ',))
user_output = read_file(input('Your output file name : '))
wrong_results = []
n = int(input_cases[0])
/*
* 19.09.2014
* Gurupad M Mamadapur
*
*/
///Next Fit allocation technique
#include<stdio.h>
#include<stdlib.h>
typedef struct block
{
/*
* 19.09.2014
* Gurupad M Mamadapur
*/
///Next Fit allocation technique
#include<stdio.h>
#include<stdlib.h>
typedef struct block
{
int size;
@Protino
Protino / LRU.c
Last active August 29, 2015 14:06
/*
* 18.09.2014
* Gurupad M Mamadapur
*/
///LEAST RECENTLY USED
#include<stdio.h>
typedef struct frame
{
int pid;
int pr;
JLT
LDA
STA
1
TEST START 4096
LOOP LDA #3
- JLT LOOP
- STA RES
- STA LEN
LEN BYTE EOF
@Protino
Protino / PASS1.c
Last active August 29, 2015 14:06
/*
* 11.11.2014
* Gurupad M Mamadapur
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct input
{