Skip to content

Instantly share code, notes, and snippets.

View mujeebishaque's full-sized avatar
💭
Let it burn

Mujeeb Ishaque mujeebishaque

💭
Let it burn
View GitHub Profile
public static void Main(string[] args)
{
int initPoint = 96;
var storeRandom = new List<int>();
Random rand = new Random();
while (initPoint++ <= 122)
{
storeRandom.Add(GenerateRandomNumber(rand));
}
showRandomNumbersList(storeRandom);
<!DOCTYPE html>
<html>
<head>
<title>Change Background Color</title>
</head>
<?php
function randomHex() {
$chars = 'ABCDEF0123456789';
$color = '#';
for ( $i = 0; $i < 6; $i++ ) {
@mujeebishaque
mujeebishaque / hotspot
Last active October 11, 2018 10:16
hotspot
[Unit]
Description=Automatically generates an internet Hotspot when a valid ssid is not in range
After=multi-user.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/autohotspot
[Install]
WantedBy=multi-user.target
import tkinter
from tkinter import messagebox
main_window = tkinter.Tk()
main_window.withdraw() #remove the background window.
messagebox.showinfo('Title', "This is just a text in a message box")
messagebox.showerror('ERROR!', "Here are the details of the error that you faced right now.")
messagebox.showwarning("WARNING!", "This will only have a button with ok as text or content.")
messagebox.askyesno("Confirmation", "Do you really want to close the application.")
@mujeebishaque
mujeebishaque / interfaces.txt
Last active December 4, 2018 16:22
sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "Your_ssid"
@mujeebishaque
mujeebishaque / pipenv_poetry.txt
Created March 24, 2019 12:27
Learning Summary of pipenv and poetry
# Install pipenv by
>pip install pipenv
>move to working dir
>pipenv install requests python-box # install 2 packages
you can specify the version of python by
pipenv install --three
# --three means to use python 3
@mujeebishaque
mujeebishaque / cracks_detection.py
Created October 18, 2019 14:22
custom model creation and saving the model. Binary Classification, keras code for CNN
# imports
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dense, Flatten, Dropout
from batchGenerator import generateData
# creating a model - function based approach
def create_model():
model = Sequential()
@mujeebishaque
mujeebishaque / delete_xml.py
Created December 3, 2019 18:30
delete all the .xml files from your images dataset including folders, subfolders
import os
for root, dirs, files in os.walk(os.getcwd()):
for _dir in dirs:
current_dir = os.getcwd() + os.sep + _dir
for x in os.listdir(current_dir):
if x.endswith(".xml"):
# print(current_dir + os.sep + x)
os.remove(current_dir + os.sep + x)
@mujeebishaque
mujeebishaque / openpyxl writer multiple images
Created April 1, 2020 11:02
add multiple images using openpyxl
def real_writer(self, folder_name=None, images=None):
if images is None or len(images) ==0:
return
import openpyxl
from openpyxl.drawing.image import Image
workbook = openpyxl.Workbook()
# Let's use the hello_world spreadsheet since it has less data
# workbook = load_workbook(filename="hello_world.xlsx")
@mujeebishaque
mujeebishaque / write_images_to_excel.py
Created April 1, 2020 15:16
write and position multiple images in excel using openpyxl
def write_excel_second(self, folder_name=None, images=None):
import openpyxl
from openpyxl import load_workbook
from openpyxl.drawing.spreadsheet_drawing import AbsoluteAnchor
from openpyxl.drawing.xdr import XDRPoint2D, XDRPositiveSize2D
from openpyxl.utils.units import pixels_to_EMU, cm_to_EMU
# print('========>', folder_name, images)
if images is None or len(images) == 0: