Skip to content

Instantly share code, notes, and snippets.

View Tes3awy's full-sized avatar
👨‍💻
Focusing

Osama Abbas Tes3awy

👨‍💻
Focusing
View GitHub Profile
@Tes3awy
Tes3awy / gist:6dd5b45c1c6bbd8c673eb8421f4032c6
Last active September 24, 2017 15:09 — forked from bergantine/gist:5243223
CSS grayscale filter (go from grayscale to full color on hover) #css #sethneilson
/* At first the image is grayscaled by the filter and then on hover the filter is set to 0% */
img {
-moz-filter: grayscale(100%);
-o-filter: grayscale(100%);
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
-moz-transition: .5s ease-in-out;
-o-transition: .5s ease-in-out;
-webkit-transition: .5s ease-in-out;
@Tes3awy
Tes3awy / sass-7-1-pattern.scss
Created August 1, 2019 12:17 — forked from rveitch/sass-7-1-pattern.scss
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@Tes3awy
Tes3awy / asyncio.md
Created November 2, 2021 05:15 — forked from ipwnponies/asyncio.md
concurrent.futures (threading) vs. asyncio (event loop)

Summary

This gist demonstrates the difference between threading and asyncio. To be clear, they're both limited by the Global Interpreter Lock and are both single process, multi-threaded. They are both forms of concurrency but not parallelism.

Threading, via concurrent.futures

Threading (via Thread, concurrent.futures) employs time-slicing of CPU. All threads are given a slot of CPU time to do work. If the thread is blocking (sleeping or blocked on sockets), then off it goes to the next thread. With many threads that are blocked for long periods, this begins to degrade into polling (polling vs. interrupt)

@Tes3awy
Tes3awy / serial_conn.py
Last active December 31, 2021 14:28 — forked from TannerRayMartin/serial_test1.py
Connecting to a Cisco switch via console cable through a serial port with a laptop using Python3 (pySerial)
__author__ = "Tanner Ray Martin & Osama Abbas"
__version__ = "1.1.0"
import time
import serial
# Creating your serial object
ser_conn = serial.Serial(
port="COM3", # COM is on windows, linux is different
@Tes3awy
Tes3awy / netmiko_threading_queuing.py
Last active February 14, 2024 11:40 — forked from consentfactory/netmiko_threading_queuing.py
Script to perform multithreading with Netmiko.
#!/usr/bin/python3
# Jimmy Taylor and Osama Abbas
# https://www.consentfactory.com/python-threading-queuing-netmiko/
# This method will spin up threads and process IP addresses in a queue
import os
import signal
# threading library
import threading