>>> def widen_str(string):
... return(''.join([chr(0xFEE0 + ord(char)) for char in string]))
...
>>> widen_str('Hello, World!')
'Hello,\uff00World!'
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
# vim: filetype=neomuttrc | |
# Default index colors: | |
color index yellow default '.*' | |
color index_author red default '.*' | |
color index_number blue default | |
color index_subject cyan default '.*' | |
# For new mail: | |
color index brightyellow black "~N" | |
color index_author brightred black "~N" |
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/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
WIDE_MAP = dict((i, i + 0xFEE0) for i in range(0x21, 0x7F)) | |
WIDE_MAP[0x20] = 0x3000 | |
def widen(s): | |
""" | |
Convert all ASCII characters to the full-width counterpart. |
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/env python3 | |
# usage | |
# | |
# 1. Make the above script executable: | |
# chmod +x logwatcher.py | |
# | |
# 2. Add a cronjob to start it after reboot like: | |
# @reboot /home/YOURUSERNAME/logwatcher.py "/var/log/auth.log" "session opened for user" "/sbin/myscript.sh" | |
# | |
# arguments are: |
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/env python3 | |
# 1. Just fill 'app token' and 'user key' below, | |
# 2. make the script executable: chmod +x simple-python-pushover.py | |
# 3. run in command line. | |
# Dependencias are python3 and `requests` lib | |
APP_TOKEN = '' | |
USER_KEY = '' | |
import requests as r |
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/env python3 | |
import sys, os | |
linelist = list(sys.stdin) | |
# gets the biggest line | |
biggest_line_size = 0 | |
for line in linelist: | |
line_lenght = len(line.expandtabs()) |
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
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then | |
tmux attach-session -t "$USER" || tmux new-session -s "$USER" | |
fi |
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
#!env ruby | |
# | |
# brew install sox | |
# | |
def play(note, octave=1) | |
"play -q -n synth sq #{note}#{octave} remix - fade 0 .6 .1 norm; " | |
end | |
song_notes = %w(B A G A B B B A A A G D D B A G A B B B B A A B A G) |
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 subprocess | |
import time | |
def wait(seconds): | |
time.sleep(seconds) | |
def play_note(note='C', duration=4, delay=0): | |
# requires sox to be installed |
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
<script src="https://rawgit.com/paulrosen/abcjs/master/bin/abcjs_plugin_3.1.1-min.js"></script> | |
<script> | |
abcjs_plugin_autostart = false; | |
window.ABCJS.plugin.auto_render = false; | |
ABCJS.plugin.hide_abc = true; | |
ABCJS.plugin.render_options = { | |
scale: 1, | |
staffwidth:700, | |
paddingtop: 0, |