Skip to content

Instantly share code, notes, and snippets.

@paramaggarwal
paramaggarwal / gist:3736871
Created September 17, 2012 11:47
Arrow Snippet - Multiple LED Matrix control from Arduino
const int clockPin = 12;
const int latchPin = 11;
const int dataPin1 = 7;
const int dataPin2 = 6;
const int dataPin3 = 5;
byte displayBuffer[24]= {0x18,0x3C,0x66,0xDB,0x18,0x18,0x18,0x18, 0x18,0x3C,0x66,0xDB,0x18,0x18,0x18,0x18, 0x18,0x3C,0x66,0xDB,0x18,0x18,0x18,0x18};
void setup() {
pinMode(clockPin, OUTPUT);
@paramaggarwal
paramaggarwal / MultipleDisplayText.ino
Created September 17, 2012 11:55
Scrolling Text on three Feemo Matrix Adapters using Arduino
const int clockPin = 12;
const int latchPin = 11;
const int dataPin1 = 7;
const int dataPin2 = 6;
const int dataPin3 = 5;
byte arrow[8]={0x18,0x3C,0x66,0xDB,0x18,0x18,0x18,0x18};
byte displayBuffer[24]= {0};
int fontDefinitions[475] = {
@paramaggarwal
paramaggarwal / gist:3737474
Created September 17, 2012 14:05
Arduino WiFly Shield Example Code
#include <SPI.h>
#include <WiFly.h>
// Wifi parameters
char passphrase[] = "passphrase";
char ssid[] = "ssid";
WiFlyClient client("google.com", 80);
void setup() {
@paramaggarwal
paramaggarwal / MultipleTweets.ino
Created September 17, 2012 14:21
Scrolling Tweets using multiple LED matrix displays
#include <SPI.h>
#include <WiFly.h>
#include <avr/pgmspace.h>
#define DELAY 100
#define SPEED 20
char passphrase[] = "digital6";
char ssid[] = "APE-1349";
const int clockPin = 3; //13
@paramaggarwal
paramaggarwal / FeemoMatrixAdapter.ino
Created September 17, 2012 16:05
Feemo Matrix Adapter Sample Code
const int clockPin = 13;
const int dataPin = 11;
const int latchPin = 10;
byte arrow[8]={0x18,0x3C,0x66,0xDB,0x18,0x18,0x18,0x18};
byte displayBuffer[8]= {0};
int fontDefinitions[475] = {
0x00,0x00,0x00,0x00,0x00,/*space*/ // is 32 in ASCII
0x00,0xF6,0xF6,0x00,0x00,/*!*/
@paramaggarwal
paramaggarwal / TableRowItem.js
Created February 4, 2015 05:37
React Native clone's example JS file for rows in the search results.
/** @jsx Rubber.createElement */
var Rubber = require('./rubber');
var TableRowItem = Rubber.createClass({
getInitialState: function() {
return {
name: '',
key: null,
didSelectRow: null
@paramaggarwal
paramaggarwal / scrape.js
Created April 3, 2015 04:09
Scrape a few products into Elasticsearch
var elasticsearch = require('elasticsearch');
var es = new elasticsearch.Client();
var superagent = require('superagent');
var async = require('async');
var _ = require('underscore');
es.info(function (err, data) {
if (err) {
return console.error(err);
};
@paramaggarwal
paramaggarwal / RNTRigidShadowView.h
Created January 14, 2016 15:00
React Native Rigid Aspect Ratio Component
#import "RCTShadowView.h"
@interface RNTRigidShadowView : RCTShadowView
/**
* Makes the box rigid, and sizes itself in flex with the
* defined aspect ratio of the CGSize rectangle.
*/
@property (nonatomic, assign) CGSize box;
@paramaggarwal
paramaggarwal / hough.md
Created January 26, 2017 11:50
A small guide to Hough Transform

How to build an intuition for the various parameters in Hough Transform?

The rho and theta units are part of the Hough Transform, but the value we give here specifies the imaginary grid that we create in this transformed domain. For example in the threshold parameter, we say that each grid box should have atleast x intersections. So the grid itself is defined by these parameters.

In the hough transform, the x and y coordinates become rho and theta. To be able to define imaginary boxes in this space, I need to give a width and height to them. This will be the rho and theta values in this domain. And then in the next parameter I say, “Hey, now in each of these rectangular imaginary boxes, you should see atleast N number of interections - if so, then it is a line."

It allows us to specify the straightness of a line. As in, should a slightly curved line also be a line? If a line is curving, all the corresponding hough lines won’t intersect perfectly. So by specifying a large imagi

@paramaggarwal
paramaggarwal / Dockerfile
Last active September 25, 2017 03:17
Docker image with ROS Kinetic and Dataspeed DBZ
FROM osrf/ros:kinetic-desktop-full
MAINTAINER Param Aggarwal (paramaggarwal@gmail.com)
# Install DBZ ADAS Kit
RUN apt-get update
RUN apt-get install -y python3-pip python-wstool
RUN mkdir -p ~/dbw_ws/src && cd ~/dbw_ws && wstool init src
RUN wstool merge -t ~/dbw_ws/src https://bitbucket.org/DataspeedInc/dbw_mkz_ros/raw/default/dbw_mkz.rosinstall
RUN wstool update -t ~/dbw_ws/src
RUN rosdep update && rosdep -y install --from-paths ~/dbw_ws/src --ignore-src