Skip to content

Instantly share code, notes, and snippets.

View lablnet's full-sized avatar
🤗
I may be slow to respond.

Muhammad Umer Farooq lablnet

🤗
I may be slow to respond.
View GitHub Profile
@lablnet
lablnet / lampStack.sh
Created November 8, 2020 04:37
A simple bash script to install lamp-stack (Apache, Mysql and PHP) on your Linux Debian based system
#!/bin/bash
echo ".....Let's Install Lamp Stack (Apache, MySql and PHP)....."
echo "Installing in progress step 1 of 4"
echo "Updating the repo..."
sudo apt -y update
clear
echo "Installing in progress step 2 of 4"
sudo apt install -y apache2
@lablnet
lablnet / task1.cpp
Last active November 5, 2020 02:57
Lab 03
#include <iostream>
class Rectangle {
private:
double length;
double width;
bool error;
public:
@lablnet
lablnet / Main.java
Last active November 3, 2020 02:56
OOP Class Assignment 01
package com.company;
import java.util.Scanner;
class Rectangle {
private double length;
private double width;
private boolean error;
@lablnet
lablnet / lab_2_1.cpp
Created October 27, 2020 10:08
Lab OOP 2
#include <iostream>
#include <string>
class Laptop {
private:
std::string brand, model;
int serial, ram;
float price, processorSpeed, screenSize;
public:
const std::string &getBrand() const {
@lablnet
lablnet / string.py
Created October 23, 2020 10:02
Simple list of python functions to manipulate strings and understand how they can works!q
def _to_lower(text: str) -> str:
upper = ""
for i in text:
if 65 <= ord(i) <= 90:
upper += chr(ord(i) + 32)
else:
upper += i
return upper
import 'dart:async';
Future longRunningOperation() async {
for (int i = 0; i < 5; i++) {
await Future.delayed(Duration(seconds: 1));
print("index: $i");
}
}
main() {
@lablnet
lablnet / task03.cpp
Last active October 14, 2020 09:22
Lab 02 tasks
//
// Created by lablnet on 10/14/20.
//
#include <iostream>
// we can use C++ vector to make it dynamic size but that was not requirement.
struct Weather {
float totalRainFall[6];
float temp[6];
float lowTemp[6];
@lablnet
lablnet / Range.py
Last active October 23, 2020 10:03
Replicate of python range class in Python Class `Range` to understand how it works under the hood.
class Range:
def __init__(self, start, stop=None, step=1):
if step == 0:
raise ValueError("Step can not be zero.")
if stop is None:
start, stop = 0, start
# calculate the effective length once
self.length = max(0, ((stop - start) + (step - 1)) // step)
INTEGER, PLUS, MINUS, MULTIPLY, DIV, EOF = 'INTEGER', 'PLUS', 'MINUS', 'MULTIPLY', 'DIV', 'EOF'
class Token():
def __init__(self, type, value):
self.type = type
self.value = value
def __str__(self):
return 'Token({type}, {value})'.format(
<VirtualHost *:80>
ServerName git.muhammadumerfarooq.com
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
SetEnv proxy-sendcl
ProxyPreserveHost On
ProxyPass /git http://127.0.0.1:3000/