Skip to content

Instantly share code, notes, and snippets.

View navinpai's full-sized avatar

Navin Pai navinpai

View GitHub Profile
@navinpai
navinpai / AndroidManifest.xml
Created September 23, 2016 19:29
AndroidManifest to use camers
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/>
@navinpai
navinpai / MainActivity.java
Created September 23, 2016 19:20
MainActivity for OpenCV
package navin.tuts.opencvapp; // Change this to your package
import android.content.pm.ActivityInfo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceView;
import android.view.Window;
import android.view.WindowManager;
@navinpai
navinpai / camera.xml
Created September 23, 2016 19:03
camera.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
xmlns:opencv="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:id="@+id/camera_activity">
<org.opencv.android.JavaCameraView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@navinpai
navinpai / static.java
Created September 23, 2016 18:48
Static initialize OpenCV on Android
private static final String TAG = "OpenCV::Main";
static {
if(!OpenCVLoader.initDebug()){
Log.d(TAG, "OpenCV not loaded");
} else {
Log.d(TAG, "OpenCV loaded");
}
}
@navinpai
navinpai / README.md
Last active May 24, 2017 07:03
Boostrap Scripts to Install and Test Setup for Deep Learning Applications

Boostrap Scripts to Install and Test Setup for Deep Learning Applications

This gist is simply a set of scripts to install and test everything you need to get started with Deep Learning. This includes:

  • TensorFlow
  • Theano
  • Keras
  • CUDNN
  • CUDA Toolkit
  • Misc. linux Tools like tmux.
@navinpai
navinpai / lookoutside.js
Last active August 29, 2015 14:27
Look Outside
//Script which takes the current APOD photo and shows it in an svg along with a #LookOutside reminder
$.get( "https://api.nasa.gov/planetary/apod?api_key=NNKOjkoul8n1CH18TWA9gwngW1s1SmjESPjNoUFo", function(data) {
var url = data.url;
var bg = document.createElementNS('http://www.w3.org/2000/svg','image');
bg.setAttributeNS(null,'height','450');
bg.setAttributeNS(null,'width','600');
bg.setAttributeNS('http://www.w3.org/1999/xlink','href',url);
bg.setAttributeNS(null, 'visibility', 'visible');
$('#lookoutside').append(bg);
@navinpai
navinpai / check-top1000.sh
Created March 16, 2015 20:28
script to check how many of the top 100 sites are blocked by CyberRoam
#!/bin/bash
# To get the data
# curl -s -O http://s3.amazonaws.com/alexa-static/top-1m.csv.zip ; unzip -q -o top-1m.csv.zip top-1m.csv ; head -1000 top-1m.csv | cut -d, -f2 | cut -d/ -f1 > topsites.txt
# Process Data
cat topsites.txt | while read line
do
echo $line
count=$( wget -T 30 -qO- $line | grep -c "><font class=accessdeniedcategoryfont>")
@navinpai
navinpai / tornadoplaybook.py
Created January 9, 2015 11:12
Tornado Playbook
import tornado.ioloop
import tornado.web
settings = {
"login_url": "/login",
"xsrf_cookies": True,
"cookie_secret":"53CR3T", #change in prod... duh!
"debug":True,
}
@navinpai
navinpai / download_naruto_shippuden.py
Last active August 29, 2015 14:07
Download all Naruto Shippuden Episodes from http://www.naruget.net/naruto-shippuden-episodes/ (380 Episodes, ~25GB on 8-10-14)
#!/usr/bin/python
import urllib2
from bs4 import BeautifulSoup
import requests
import re
import urllib
import sys
import os
episodeArray=[]
// ==UserScript==
// @namespace CS255
// @name CS255
// @description CS255 - Assignment 1
// @version 1.1
//
//
// @include http://www.facebook.com/*
// @include https://www.facebook.com/*
// @exclude http://www.facebook.com/messages/*