Skip to content

Instantly share code, notes, and snippets.

View jayrambhia's full-sized avatar

Jay Rambhia jayrambhia

View GitHub Profile
@jayrambhia
jayrambhia / Android TopSheetDialog Implementation by Taskito.md
Last active December 16, 2023 12:36
Android Top Sheet Implementation
<style name="TopSheet_DialogAnimation">
  <item name="android:windowEnterAnimation">@anim/slide_out_from_top</item>
  <item name="android:windowExitAnimation">@anim/slide_back_to_top</item>
</style>

slide_out_from_top

#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <opencv2/core/core.hpp>
@jayrambhia
jayrambhia / BattleshipActivity.kt
Last active April 21, 2023 14:11
Battleship game in Kotlin
class BattleshipActivity: AppCompatActivity() {
private lateinit var gridAdpater: UiCellAdapter
private lateinit var myBoard: Board
private lateinit var otherBoard: Board
private val width: Int = 10
override fun onCreate(savedInstanceState: Bundle?) {
@jayrambhia
jayrambhia / IMDB.py
Last active April 15, 2023 07:57
Fetch movie information from IMDB using Python!
'''
Author : Jay Rambhia
Git : https://github.com/jayrambhia
gist : https://gist.github.com/jayrambhia
'''
import urllib2
from BeautifulSoup import BeautifulSoup
from mechanize import Browser
import re
@jayrambhia
jayrambhia / bookmark-json.py
Created January 28, 2012 06:52
Fetch Bookmark details from temp files of browsers using json
"""
Created on Fri Jan 27 21:48:58 2012
@author: jay
"""
import json
import os
import gdbm
import time
@jayrambhia
jayrambhia / Makefile
Created May 30, 2013 12:53
Using Kinect with Freenect and OpenCV (C++ version)
CXXFLAGS = -O2 -g -Wall -fmessage-length=0 `pkg-config opencv --cflags ` -I /usr/include/libusb-1.0
OBJS = freenectopencvmat.o
LIBS = `pkg-config opencv --libs` -lfreenect
TARGET = kinectopencv
$(TARGET):$(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
all:$(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
@jayrambhia
jayrambhia / Android.mk
Created May 1, 2014 10:44
FFmpeg with OpenCV on Android
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_LIB_TYPE:=STATIC
OPENCV_INSTALL_MODULES:=on
include /home/jay/Android_OpenCV/OpenCV-2.4.8-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := tutorial02
@jayrambhia
jayrambhia / bookmark.py
Created February 1, 2012 22:49
A python script to back up all the bookmarks(firefox compatible). It returns a dictionary with url as key and (title, tag, add_date, modified_date) tuple as the value. It also stores it in gdbm. Another script is provided to read all the bookmarks.
'''
Author: Jay Rambhia
email : jayrambhia777@gmail.com
A new script supporting both Mozilla Firefox and Google Chrome bookmarks:
https://github.com/jayrambhia/Bookmark-Manager
'''
import os
import json
import pickle
import gdbm
@jayrambhia
jayrambhia / ColorDetector.java
Last active June 22, 2021 19:00
ColorDetector - Lint detector
public class ColorDetector extends ResourceXmlDetector {
private static final String ID = "CustomColors";
private static final String DESCRIPTION = "Custom colors used";
private static final String EXPLANATION = "Use pre-defined (allowed) colors only";
private static final Category CATEGORY = Category.CORRECTNESS;
private static final int PRIORITY = 6;
private static final Severity SEVERITY = Severity.ERROR;
public static final Issue ISSUE = Issue.create(
@jayrambhia
jayrambhia / FaceRecognize_update,py
Created April 16, 2013 22:52
Update utility for FaceRecognize Moudle in SimpleCV.
def update(self, images=None, labels=None, csvfile=None, delimiter=";"):
"""
**SUMMARY**
Update the training set of the face recognizer.
**PARAMETERS**
* *images* - A list of Images or ImageSet. All the images must be of
same size.