Skip to content

Instantly share code, notes, and snippets.

View gggauravgandhi's full-sized avatar
🤓
Something can always be better, nothing is ever complete 🚀

Gaurav gggauravgandhi

🤓
Something can always be better, nothing is ever complete 🚀
View GitHub Profile
@gggauravgandhi
gggauravgandhi / disp_multiple_images.py
Created December 19, 2018 14:27 — forked from timoklock/disp_multiple_images.py
Plot multiple images with matplotlib in a single figure. Titles can be given optionally as second argument.
import matplotlib.pyplot as plt
import numpy as np
def show_images(images, cols = 1, titles = None):
"""Display a list of images in a single figure with matplotlib.
Parameters
---------
images: List of np.arrays compatible with plt.imshow.
@gggauravgandhi
gggauravgandhi / knick-knack-bot.js
Last active August 14, 2019 09:28 — forked from jabczyk/knick-knack-bot.js
Consumes all knick-knacks in Your steam inventory
/**
* Knick Knack Steam Bot
*
* Consumes all knick-knacks in Your steam inventory
*
* - Go to https://steamcommunity.com/my/inventory#753_6
* - Wait for inventory to load
* - Press F12
* - Paste the code in console tab
*
@gggauravgandhi
gggauravgandhi / knick-knack-bot.js
Created January 2, 2019 16:22 — forked from TarasDev/knick-knack-bot.js
Consumes all knick-knacks in Your steam inventory
/**
* Knick Knack Steam Bot
*
* Consumes all knick-knacks in Your steam inventory
*
* - Go to https://steamcommunity.com/my/inventory#753_6
* - Wait for inventory to load
* - Press F12
* - Paste the code in console tab
*

Tips for a #WINNING Github Profile

The basics

As a new developer some potential employers are going to review your Github profile as part of the interview process. This doc covers some tips that should help you make a good impression. What this doc won't do is polish a turd.

README

Think of your experiences reviewing a Gem or other JS library on Github. Where do you look first? The README of course. What makes for a frustrating repo? One that doesn't:

  • include a README.
  • include install instructions (if applicable)
@gggauravgandhi
gggauravgandhi / Trimmed battery output using acpi
Created March 22, 2019 05:31
Trimmed battery output using acpi command with battery header removed
acpi -b | sed -e 's/Battery 0: //g'
@gggauravgandhi
gggauravgandhi / output.json
Created August 8, 2019 18:03
Microsoft's Cognitive Services Face API's Output
[
{
"faceId": "68256b86-2234-4cc5-ad40-748e190073ec",
"faceRectangle": {
"top": 819,
"left": 3533,
"width": 565,
"height": 565
},
"faceAttributes": {
@gggauravgandhi
gggauravgandhi / face-api.py
Last active September 25, 2019 07:31
Microsoft Azure Cognitive Services Face API demo in Python
import requests
data = open('./test.jpg', 'rb').read()
# Documentation : https://southeastasia.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236/console
params = {
'returnFaceId': 'true',
'returnFaceLandmarks': 'false',
'returnFaceAttributes': 'age,gender,headPose,smile,facialHair,glasses,emotion,hair,makeup,occlusion,accessories,blur,exposure,noise',
}
@gggauravgandhi
gggauravgandhi / resize-image-with-padding.py
Last active May 21, 2020 21:01
Resize image by maintaining aspect ratio with adding padding
import numpy as np
import PIL
from PIL import Image
def resize_image(np_img):
"""Resizes image with maintaining aspect ratio"""
# Convert numpy array image into Pillow format image
im = Image.fromarray(np_img)
# Find max size of an image
@gggauravgandhi
gggauravgandhi / mmdetection-install.md
Created May 29, 2020 07:22
mmdetection installation on ubuntu

Install dependecies

pip install docopt cython imgaug matplotlib mmcv requests torch==1.2.0 torchvision==0.4.0 terminaltables

pip install torchvision==0.4.0

@gggauravgandhi
gggauravgandhi / neofetch_loop.sh
Last active June 9, 2020 08:50
Neofetch print color output every x seconds with buffer using while loop
while true; do neofetch --backend off > /tmp/neofetch_file; clear; cat /tmp/neofetch_file; sleep 60; done
# or
watch -ctn 1 'neofetch | sed "s/25[hl]//g;s/7[hl]//"'