Skip to content

Instantly share code, notes, and snippets.

View Kaveh8's full-sized avatar
🎯
Focusing

Kaveh Shahhosseini Kaveh8

🎯
Focusing
View GitHub Profile
@Kaveh8
Kaveh8 / disable_touchpad_linux.sh
Last active August 31, 2023 00:26
A bash script for disabling touchpad in Linux
#!/bin/bash
mouse=`xinput | grep 'Mouse' | cut -d$'\t' -f2`
touch=`xinput | grep 'Touchpad' | cut -d$'\t' -f2`
echo 'Mouse' $mouse
echo 'Touch' $touch
mouse_id=`echo $mouse | cut -d '=' -f 2`
touch_id=`echo $touch | cut -d '=' -f 2`
@Kaveh8
Kaveh8 / tictactoe.pas
Last active August 31, 2023 00:26
Graphical tic-tac-toe game (Computer vs Human) in Turbo Pascal
program tictactoe;{Kaveh Shahhosseini}
uses graph,crt,dos;
type
dooz=array[1..3,1..3]of integer;
const
directory='e:\tp\bgi';
var
driver,mode,size,i,j:integer; {For Graphic}
m:dooz; {Dooz Array}
n,y,w,q,p:byte;
@Kaveh8
Kaveh8 / check_invalid_images.py
Last active August 31, 2023 00:27
python snippet for checking invalid image files in a directory
import os
import imghdr
path = "./dataset/PetImages/dog/"
dir_ = os.listdir(path)
for image in dir_:
file = os.path.join(path,image)
if not imghdr.what(file):
print(file)
#if you want to remove them, uncomment next line
# -*- coding: utf-8 -*-
"""MultivariateTimeSeriesCaesar.ipynb
data file link "data1.csv": https://drive.google.com/file/d/1myS-vocjesqoRb21RjK9FYqnUHpv8-KW/view?usp=sharing
"""
import math
import matplotlib.pyplot as plt
import tensorflow as tf
import pandas as pd
@Kaveh8
Kaveh8 / turtle.py
Created April 19, 2020 10:31
Turtle
import turtle
ts = turtle.getscreen()
turtle.ht()
fname = 'graph.eps'
# Prime numbers forming the final number
nums = [2, 3, 5, 7, 11, 13, 17, 19]
# The final number
n = 1