This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__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 |
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 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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sass/ | |
| | |
|– base/ | |
| |– _reset.scss # Reset/normalize | |
| |– _typography.scss # Typography rules | |
| ... # Etc… | |
| | |
|– components/ | |
| |– _buttons.scss # Buttons | |
| |– _carousel.scss # Carousel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; |