Emoji | Purpose | MD Markup | Prefix |
---|---|---|---|
📄 | Generic message | :page_facing_up: |
|
📐 | Improve the format / structure of the code / files | :triangular_ruler: |
[IMPROVE]: |
⚡ | Improve performance | :zap: |
[IMPROVE]: |
🚀 | Improve something (anything) | :rocket: |
[IMPROVE]: |
📝 | Write docs | :memo: |
[PROD]: |
💡 | New idea |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Install virtualenv, virtualenv wrapper | |
# sudo pip3 install virtualenv virtualenvwrapper | |
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 | |
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv | |
export WORKON_HOME=$HOME/.virtualenvs | |
# export PROJECT_HOME=$HOME/Devel | |
source /usr/local/bin/virtualenvwrapper.sh |
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
# All thanks to a thread in this forum: https://askubuntu.com/questions/360293/could-not-calculate-the-upgrade-what-happened | |
#!/bin/bash | |
apt update | |
apt upgrade | |
cat /var/log/dist-upgrade/apt.log | egrep -o "^Broken\s[a-z:\.0-9-]*" | sed 's/Broken //' | sed 's/:amd64//' > packages.txt | |
sort -u packages.txt > packages_sorted.txt | |
while read line; do | |
apt remove -y $line | |
done < packages_sorted.txt |
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
import cv2 | |
import datetime | |
print(cv2.__version__) | |
def video_writer_decorator(func): | |
def wrapper(cap): | |
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) | |
h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) | |
fps = int(cap.get(cv2.CAP_PROP_FPS)) |
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
import pyautogui | |
import time | |
#user note: | |
# cursor will keep moving on 2 diagonals of a 5x5 square and cilcking - better to position it inside the terminal from which this script is triggered | |
#pyautogui.FAILSAFE = False # uncomment this if you want to disable the pause script if cursor in corner feature | |
while True: | |
pyautogui.move(-5,5) | |
pyautogui.click() |
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
import tensorflow as tf | |
from tensorflow.python.client import device_lib | |
print(tf.test.is_gpu_available()) | |
print(tf.config.experimental.list_physical_devices('GPU')) | |
print(device_lib.list_local_devices()) | |
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
{ | |
// Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", |
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
echo "Enter brightness percentage: " | |
read x | |
xrandr --output eDP-1 --brightness ${x} | |
echo "Brightness has been changed to ${x}" | |
echo "Exiting..." |
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
def get_python_version(): | |
from platform import python_version | |
print("python_version: ", python_version()) |
NewerOlder