Skip to content

Instantly share code, notes, and snippets.

View yokeshrana's full-sized avatar
🏠
Working from home

Yokesh Rana yokeshrana

🏠
Working from home
View GitHub Profile
@yokeshrana
yokeshrana / opencvNotes.py
Created March 8, 2021 20:06
Full Open CV Notes
enable=False
'''
Reading Image
'''
if enable:
import cv2
img = cv2.imread("Resources/lena.png")
'''
Face Detection
-> Using method used by Viola and jones (real time object detection)
-> We will use lot of images with positive faces and negative faces and will train the cascade file to detect the faces
-> In Open CV we dont have to actually do this we can use trained cascade file to detect things
'''
import cv2
faceCascade = cv2.CascadeClassifier("Resources/haarcascade_frontalface_default.xml")
img = cv2.imread("Resources/lena.png")
imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
@yokeshrana
yokeshrana / machine_coding_snakeandladder
Created April 2, 2021 11:07
Machine Coding Snake and Ladder Game
#include <iostream>
#include <map>
#include <vector>
using namespace std;
class Snake{
int end;
public:
Snake() {}
Snake(int anEnd) : end(anEnd) {}
@yokeshrana
yokeshrana / safari_dark_mode.js
Created May 20, 2026 19:42
dark mode safari
/**
* background.js — Smart Dark Mode Extension
*
* Responsibilities:
* - Icon state management
* - Forwarding toggle messages to active tab
* - Re-injecting content script into existing tabs on install/update
* - Responding to tab URL changes (re-trigger smart detection per page)
*/