This file contains hidden or 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
#!/bin/bash | |
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152 | |
# Inspired by https://gist.github.com/viking/5851049 but with support for tmux | |
CWD='' | |
# Get window ID | |
ID=$(xdpyinfo | grep focus | cut -f4 -d " ") | |
# Get PID of process whose window this is |
This file contains hidden or 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
""" | |
Progress bar for rsync | |
======================== | |
Shows file progress and total progress as a progress bar. | |
Usage | |
--------- | |
Run rsync with -P and pipe into this program. Example:: |
This file contains hidden or 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
Mutt | |
http://www.mutt.org/doc/manual/manual.html | |
Select (tag) messages: shift+t (T) | |
= (string) | |
~ (expression) | |
~b expr (message with expr in body) | |
[b]body |
This file contains hidden or 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 mutt using brew | |
$ brew install mutt | |
# Configure mutt | |
$ vim ~/.muttrc | |
# Put the following on the mutt config file (.muttrc) | |
set imap_user = “YOUR_USERNAME@GMAIL_OR_YOUR_DOMAIN.com” | |
set imap_pass = “YOUR_PASSWORD” | |
set smtp_url = “smtp://YOUR_USERNAME@[email protected]:587/” |
This file contains hidden or 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 os | |
def createFolder(directory): | |
try: | |
if not os.path.exists(directory): | |
os.makedirs(directory) | |
except OSError: | |
print ('Error: Creating directory. ' + directory) | |
This file contains hidden or 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
BLACK_COLOR = "#000000" | |
WHITE_COLOR = "#FFFFFF" | |
def get_contrast_color(background_color: str) -> str: | |
""" | |
Util function to determine what's the best color between black or white to choose for a text | |
depending on the background color given in parameter. | |
Based on algorythm from WCAG 2.0 explained here : https://www.w3.org/TR/WCAG20-TECHS/G18.html#G18-tests | |
:param background_color: the background color in HEX format (eg: #9D412B) |
OlderNewer