Skip to content

Instantly share code, notes, and snippets.

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

Muhammad Umer Farooq lablnet

🏠
Working from home
View GitHub Profile
@lablnet
lablnet / gcd.py
Created August 24, 2020 10:58
Pythonic way to find GCD.
def gcd(a, b):
return a if b == 0 else gcd(b, a % b)
print(gcd(int(input("Enter value of a: ")), int(input("Enter value of b: "))))
@lablnet
lablnet / ddos_attack.py
Last active August 24, 2020 07:29
python script to DDoS attack to any server, i will not accept any illegal usage of this script
"""ddos_attack.py: A python script to DDoS attack to any server."""
__author__ = "Muhammad Umer Farooq"
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Muhammad Umer Farooq"
__email__ = "[email protected]"
__status__ = "Production"
"""
DDoS: https://en.wikipedia.org/wiki/Denial-of-service_attack
Caution: i will not accept any illegal usage of this script, this is
@lablnet
lablnet / c_print.py
Last active August 7, 2020 09:01
Enable coloured print in python
"""c_print.py: Enable coloured print."""
__author__ = "Muhammad Umer Farooq"
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Muhammad Umer Farooq"
__email__ = "[email protected]"
__status__ = "Production"
def c_print(msg, color=None):
@lablnet
lablnet / waste_mem.cpp
Created July 30, 2020 07:26
Simple C++ program to waste memory
#include <iostream>
#include <cstring>
#ifdef _WIN32
#include <Windows.h>
#else
#include <unistd.h>
#endif
#define MB (1024*1024)
int main()
@lablnet
lablnet / prime.cpp
Created July 20, 2020 10:54
Prime Number
#include <iostream>
#include <chrono>
using namespace std;
bool isPrime(long long int);
int main(){
long long int n=0;
cout<<"Enter number"<<endl;
cin>>n;
auto start=chrono::high_resolution_clock::now();
#include<iostream>
#include<fstream>
using namespace std;
// define a structure to store student data
struct student {
int sapid;
char name[30];
float marks;
void getData(); // get student data from user
void displayData(); // display data
1 Ali 230
5 Bilal 255
6 Pasha 430
//usr/bin/g++
#include <iostream>
int main() {
const int S = 5, M = 6, max = 1000;
int subjects[S][M], avg[S], sum = 0;
char students[S][max];
// Read the mark for students.
for (int i = 0; i < S; i++) {
@lablnet
lablnet / prime_number.c++
Created March 12, 2020 14:29
C++ prime find prime number using exhaustive enumeration
#include <iostream>
using namespace std;
namespace lablnet {
bool is_prime(int n)
{
bool isPrime = true;
for (int i = n - 1; i >= 2; i--)
{
if (n % i == 0)
<?php
if (isset($_POST['submit'])) {
$text = (null !== empty(trim($_POST['text']))) ? stripslashes(trim(htmlentities(htmlspecialchars(strip_tags($_POST['text']), ENT_QUOTES | ENT_HTML5, 'UTF-8'), ENT_QUOTES | ENT_HTML5, 'UTF-8'))) : '';
if ('' !== $text) {
$spilt = explode(' ', $text);
echo "<strong>Counts:</strong><br/ >";
foreach (array_unique($spilt) as $key => $value) {
$count = substr_count($text, $value);
echo "<b>$value:</b> <i>$count</i> <br>";