Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
for n in E2 A2 D3 G3 B3 E4; do play -n synth 4 pluck $n repeat 2; done
@abhinavjain241
abhinavjain241 / colour-detect-hsv.cpp
Created November 25, 2015 18:11
HSV Colour Detection
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
int main()
{
@abhinavjain241
abhinavjain241 / installed-applications
Last active March 2, 2023 15:27
A list of programs I have installed on my workstation (Ubuntu 14.04) along with their respective links.
1. Google Chrome - via Terminal - http://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line
2. VLC Media Player - via Terminal - Simply running sudo apt-get install vlc
3. git - via Terminal
4. Linux DC++ - via Software Center
5. Sublime Text - via Terminal - from Website - http://askubuntu.com/questions/172698/how-do-i-install-sublime-text-2-3
6. Ruby - via Terminal - sudo apt-get install ruby - Also set-up proxy for gems - Also install ruby1.9.1-dev - http://stackoverflow.com/questions/10725767/error-installing-jekyll-native-extension-build
7. NodeJS - sudo apt-get install nodejs
8. Bundler - gem install bundler
9. cURL - HTTP Requests - sudo apt-get install curl
10. java & javac - https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
@abhinavjain241
abhinavjain241 / DownloadMusic.sh
Last active June 9, 2024 05:00
[Shell Script] Download Music from YouTube using youtube-dl and use MusicBrainz Picard to correct Metadata
#!/bin/bash
#The script downloads the song from YouTube using youtube-dl command line utitlity. After that it calls MusicBrainz Picard (MP3 ID3 Tagger) to correct the metadata. Post that, it calls mp3info to display the ID3 tag information as well as prompts the user whether they want to play the song.
if test "$#" -lt 1; then
echo "Illegal number of parameters"
echo "Usage: dl-music [URL] [OPTIONS]"
exit
fi
if [[ "$2" == '1' ]]
@abhinavjain241
abhinavjain241 / MakeDirectory.sh
Created September 19, 2015 13:22
[Shell Script] Make directories in a folder for each of your file.
#!/bin/bash
# Reference: (Thanks StackOverflow) - http://stackoverflow.com/questions/2859908/iterating-over-each-line-of-ls-l-output
# Copy the script into a folder. Run it. This will make a folder for each of your file present in the directory.
# Helps me to organize my Movie collection.
ls -p | grep -v / | while read x; do if [[ $x != "MakeDirectory.sh" ]]; then mkdir "${x%.*}"; mv "$x" "${x%.*}"; fi done
@abhinavjain241
abhinavjain241 / classes.cpp
Created December 25, 2014 22:30
Intro to Classes - C++
#include <iostream>
using namespace std;
class Computer // Standard way of defining the class
{
public:
// This means that all of the functions below this(and any variables)
// are accessible to the rest of the program.
// NOTE: That is a colon, NOT a semicolon...
@abhinavjain241
abhinavjain241 / cv_robot.ino
Created December 12, 2014 23:18
Arduino Code for Image Processing Robot
int pin_e1 = 52;
int pin_in1_1 = 50;
int pin_in1_2 = 48;
int pin_e2 = 42;
int pin_in2_1 = 40;
int pin_in2_2 = 38;
void full_right()
{
@abhinavjain241
abhinavjain241 / CompleteEdge.cpp
Created December 11, 2014 01:28
Complete Edge Detection Module - OpenCV
//Complete Edge Detection Module - Naive Edge Detection + Prewitt + Sobel + Canny
//Also shows Gradient images in X and Y directions respectively.
#include <iostream>
#include <cmath>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#define CAM_INDEX 0
@abhinavjain241
abhinavjain241 / serialcomm.ino
Created December 5, 2014 12:42
Serial Communication (Using Arduino)
int pin_e1 = 52;
int pin_in1_1 = 50;
int pin_in1_2 = 48;
int pin_e2 = 42;
int pin_in2_1 = 40;
int pin_in2_2 = 38;
void full_right()
{
@abhinavjain241
abhinavjain241 / Binary_trackbar.cpp
Created December 3, 2014 02:52
Binary Image - Trackbar Thresholding - OpenCV
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
Mat makebinary(Mat image, int threshold)