Skip to content

Instantly share code, notes, and snippets.

View tanmaykm's full-sized avatar

Tanmay Mohapatra tanmaykm

  • Bangalore, India
View GitHub Profile
@tanmaykm
tanmaykm / sketch_sprinkler.pde
Created August 29, 2011 04:12
Arduino Sprinkler Controller
// Arduino Sprinkler
// Version: 0.4 (beta)
// Updated: 03 Oct 2011
#include <LiquidCrystal.h>
#include <EEPROM.h>
// SWITCHES
// Pin 1 (Learn/Auto)
@tanmaykm
tanmaykm / db.c
Created April 24, 2012 17:16
Memcache vs. Database for simple selects
/**
* related blogpost at http://sidekick.windforwings.com/2012/04/memcache-vs-database-for-simple-selects.html
*/
#include <mysql.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
MYSQL *conn;
@tanmaykm
tanmaykm / tmq.c
Created May 19, 2012 12:18
Inter Thread Communication: Socketpairs vs. In-Memory Buffers
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
/**
* related blogpost at: http://sidekick.windforwings.com/2012/05/inter-thread-communication-socketpairs.html
@tanmaykm
tanmaykm / merge_monthly.py
Created October 17, 2012 12:02
Python script to merge "My Archive" call and SMS logs in Google Drive
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 1 10:28:26 2012
Companion merge script for Android "My Archives" application.
App: https://play.google.com/store/apps/details?id=com.meeteoric.myarchives&hl=en
Instructions: http://sidekick.windforwings.com/2012/10/python-script-to-merge-my-archives-call.html
@author: tan
@tanmaykm
tanmaykm / sample.py
Created November 16, 2012 20:40
Using Mashape "One Time Password" API
# Sample to be used along with:
# Mashape otpgen API at https://www.mashape.com/tanmaykm/otpgen
# Related blog post at http://sidekick.windforwings.com/2012/11/a-one-time-password-service.html
import time, hashlib
from Otpgen import Otpgen
MY_MASHAPE_PUB_KEY = '__REPLACE_WITH_YOUR_MASHAPE_PUBLIC_KEY__'
MY_MASHAPE_PRIV_KEY = '__REPLACE_WITH_YOUR_MASHAPE_PRIVATE_KEY__'
MY_OTPGEN_SECRET = "secret1"
@tanmaykm
tanmaykm / motion_detect.cpp
Created December 2, 2012 15:38
OpenCV Motion Detection Based Action Trigger
/*
* motion_detect.cpp
* To accompany instructions at:
* http://sidekick.windforwings.com/2012/12/opencv-motion-detection-based-action.html
*
* Created on: Dec 02, 2012
* Author: tan
*
*/
#include <iostream>
@tanmaykm
tanmaykm / hough_impl.cpp
Created December 13, 2012 06:02
An implementation of the hough transform for demonstration purpose.
/*
* hough_impl.cpp
*
* Created on: Dec 11, 2012
* Author: tan
*
* Related blog post at:
* http://sidekick.windforwings.com/2012/12/implementing-hough-transform.html
*/
@tanmaykm
tanmaykm / cv_utils.cpp
Created December 14, 2012 11:44
Separating items in store shelves using OpenCV.
/*
* cv_utils.cpp
*
* Created on: Dec 7, 2012
* Author: tan
* Related blog post at:
* http://sidekick.windforwings.com/2012/12/opencv-separating-items-on-store-shelves.html
*
*/
@tanmaykm
tanmaykm / remap_circle.cpp
Last active December 10, 2015 06:29
OpenCV remap rectangle to circle.
/*
* remap_circle.cpp
*
* Created on: Dec 28, 2012
* Author: tan
* Related blog post at:
* http://sidekick.windforwings.com/2012/12/opencv-fun-with-remap.html
*/
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
@tanmaykm
tanmaykm / julia.jl
Last active December 14, 2015 03:59
A Julia program to generate Julia set images. Images are written on to stdout in PGM format. Args: image size (pixels. width and height are equal to this.) value of complex parameter real part value of complex parameter imaginary part Accompanying post at: http://sidekick.windforwings.com/2013/02/julia-sets-using-julia.html
# A Julia program to generate Julia set images.
# Images are written on to stdout in PGM format.
# Args:
# image size (pixels. width and height are equal to this. default 200)
# value of complex parameter real part (default 0)
# value of complex parameter imaginary part (default 0.65)
# Accompanying post at: http://sidekick.windforwings.com/2013/02/julia-sets-using-julia.html
w,h = 200
c = 0 + 0.65im