Skip to content

Instantly share code, notes, and snippets.

View Ehsan1997's full-sized avatar
💭
making machines learn how to learn

Muhammad Ehsan ul Haq Ehsan1997

💭
making machines learn how to learn
View GitHub Profile
@bertcarremans
bertcarremans / img_train_test_split.py
Last active November 5, 2021 09:49
Split images randomly over train or validation folder
# Copyright 2014-2017 Bert Carremans
# Author: Bert Carremans <bertcarremans.be>
#
# License: BSD 3 clause
import os
import random
from shutil import copyfile
@soply
soply / disp_multiple_images.py
Last active January 9, 2024 14:52
Plot multiple images with matplotlib in a single figure. Titles can be given optionally as second argument.
import matplotlib.pyplot as plt
import numpy as np
def show_images(images, cols = 1, titles = None):
"""Display a list of images in a single figure with matplotlib.
Parameters
---------
images: List of np.arrays compatible with plt.imshow.
@kolorobot
kolorobot / bootstrap.html
Last active January 18, 2021 21:15
Complete Bootstrap Starter Template with pre-defined CDN paths
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content=""/>
<meta name="author" content=""/>
@psdtohtml5
psdtohtml5 / gist:6090113
Last active September 5, 2021 16:09
PHP : Auto expire session / Auto logout after specific time
<?php
//on pageload
session_start();
$idletime=60;//after 60 seconds the user gets logged out
if (time()-$_SESSION['timestamp']>$idletime){
session_destroy();
session_unset();
}else{