Skip to content

Instantly share code, notes, and snippets.

View NISH1001's full-sized avatar
💭
Staring into the abyss...

Nish NISH1001

💭
Staring into the abyss...
View GitHub Profile
@NISH1001
NISH1001 / markdownify.py
Created April 23, 2019 06:16
convert medium blog post into markdown
#!/usr/bin/env python3
import html2text
import requests
from bs4 import BeautifulSoup
class ManualError(Exception):
def __init__(self, args):
self.args = args
@NISH1001
NISH1001 / debunking-ai
Created April 27, 2019 05:10
Debunking AI " A though
It has been a year since I gave my talk titled "Debunking AI". Here's a mini thread representing my thoughts: [start]
"Debunking AI" : A Thread
A year ago, I had come to realize how misinformed most of the people were and how today's social media and marketing schemes have generated a type of misguided "fear" in people. [1/n]
The only fear should be the mishandling of algorithms and misdirected intellectual properties, which in some ways is related to privacy. [2/n]
Nevertheless, I tried to give the presentation from my engineering perspective as to how algorithms are powerful and stupid at the same time. [3/n]
I did try giving them perspective on trending topics like fake news, deep fakes, bots, and surveillance. [4/n]
And after a year, nothing has changed, except for the fact that the hype-train is still going on surrounding AI. [5/n]
It's okay to think AI as a part of a tool, to be able to integrate to existing systems allowing "human" in the loop. But from a developer/researcher/engineering perspective
#!/usr/bin/env python3
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import tweepy
import sys
class StdOutListener(StreamListener):
@NISH1001
NISH1001 / eval.py
Last active November 8, 2019 10:58
import os
import cv2
import shutil
import numpy as np
import skimage
from skimage import io
from skimage import transform as tf
import argparse
import torch
@NISH1001
NISH1001 / twittermute.txt
Created January 25, 2020 02:36 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@NISH1001
NISH1001 / linux-not-so-noob.md
Last active March 13, 2020 10:50
linux-not-so-noob

IO Error, Bad Block / Superblock

  • first boot into live disk/usb
  • use smartmontools
  • make sure smart mode is on using smartctl
  • figure out which /dev/sdX partition has bad blocks
  • perfrom fschk -y /dev/sdX
  • see if /dev/sdX can be mounted using mount

Make sure you aren't doing fschk from initrmfs screen which is a fallback screen in case of kernel panic

@NISH1001
NISH1001 / Transparent drawings in OpenCV.py
Created April 26, 2020 07:22 — forked from IAmSuyogJadhav/Transparent drawings in OpenCV.py
Add transparency to rectangles, circles, polgons, text or any shape drawn in OpenCV.
import cv2
image = cv2.imread('test.jpg')
overlay = image.copy()
x, y, w, h = 10, 10, 10, 10 # Rectangle parameters
cv2.rectangle(overlay, (x, y), (x+w, y+h), (0, 200, 0), -1) # A filled rectangle
alpha = 0.4 # Transparency factor.
@NISH1001
NISH1001 / randsum.py
Created April 27, 2020 08:35
generate random numbers where column sums upto something
#!/usr/bin/env python3
import numpy as np
def main():
ncols = 3
nrows = 100
arr = np.random.random((nrows, ncols))
arr = arr / arr.sum(axis=0, keepdims=1) * 100
@NISH1001
NISH1001 / randadd.py
Last active April 29, 2020 14:28
random sum user test
#!/usr/bin/env python3
import random
def main():
mn, mx = (10, 99)
correctness = 3
correct = 0
while True:
@NISH1001
NISH1001 / plates.py
Created May 24, 2020 13:29
Process plate images for stopmotion video
#!/usr/bin/env python3
from tqdm import tqdm
import glob
import os
import sys
import cv2
import matplotlib.pyplot as plt
import numpy as np