Skip to content

Instantly share code, notes, and snippets.

View faraazahmad's full-sized avatar
🏠
Working from home

Syed Faraaz Ahmad faraazahmad

🏠
Working from home
View GitHub Profile
# frozen_string_literal: true
require 'parallel'
FILE = 'input.txt'
# FILE = 'sample.txt'
raw_input = File.read(FILE)
lines = raw_input.split("\n")
seed_num_pairs = []
seed_nums = []
@faraazahmad
faraazahmad / docker-compose.kafka.yml
Created June 10, 2019 11:46
Kafka cluster docker-compose file
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
@faraazahmad
faraazahmad / sensor.c
Created April 10, 2019 06:33
ir sensor array
#include <LCD.h>
#include <stdio.h>
sbit IR1=P1^0;
sbit IR2=P1^1;
sbit IR3=P1^2;
sbit IR4=P1^3;
sbit IR5=P1^4;
// intuitive code
#include <LCD.h>
sbit IR=P1^0;
// intuitive code
void main()
{
LCD_INIT();
while(1) {
if(IR == 0) {
@faraazahmad
faraazahmad / lcd.c
Created February 27, 2019 06:46
lcd
#include <LCD.h>
/*
#define display_port P2 //Data pins connected to port 2 on microcontroller
sbit rs = P3^2; //RS pin connected to pin 2 of port 3
sbit rw = P3^3; // RW pin connected to pin 3 of port 3
sbit e = P3^4; //E pin connected to pin 4 of port 3
void msdelay(unsigned int time) // Function for creating delay in milliseconds.
{
@faraazahmad
faraazahmad / lcd_switch_counter.c
Created February 27, 2019 06:45
lcd switch counter
#include <LCD.h>
sbit l1 = P3^0;
sbit l2 = P3^1;
sbit s1 = P3^2;
sbit s2 = P3^3;
sbit s4 = P3^5;
void counter_3(){
@faraazahmad
faraazahmad / switch_counter.c
Created February 26, 2019 14:23
switch_counter
#include <p89v51rx2.h>
sbit l1 = P3^0;
sbit l2 = P3^1;
sbit l3 = P3^6;
sbit l4 = P3^7;
sbit s1 = P3^2;
sbit s2 = P3^3;
sbit s3 = P3^4;
@faraazahmad
faraazahmad / counter_buzzer.c
Created February 20, 2019 06:07
counter_buzzer
#include <p89v51rx2.h>
sbit buzzer = P0^3;
sbit l1 = P3^0;
sbit l2 = P3^1;
sbit l3 = P3^6;
sbit l4 = P3^7;
sbit s1 = P3^2;
@faraazahmad
faraazahmad / 4bitcounter.c
Created February 6, 2019 06:11
Embedded lab #3
#include <p89v51rx2.h>
void delay(unsigned int dela)
{
unsigned int i,j;
for(i=0;i<=1000;i++)
for(j=0;j<=dela;j++);
}
Verifying my Blockstack ID is secured with the address 1FXLzWj12rY4uuvwrLzFJPmbkjii72Q27k https://explorer.blockstack.org/address/1FXLzWj12rY4uuvwrLzFJPmbkjii72Q27k