Skip to content

Instantly share code, notes, and snippets.

View ShadowKyogre's full-sized avatar

ShadowKyogre

View GitHub Profile
#!/usr/bin/env python
"""
ODT2PANDOC
==========
ODT2PANDOC is a slight variant of ODT2TXT. Right now, the only differences are that it generates ATX style headers and uses *asterisks* for italics, neither of which is in any way specific to pandoc's extended markdown.
ODT2TXT
=======
@ShadowKyogre
ShadowKyogre / gen_article_names.py
Created February 17, 2015 04:03
Written in Python 3. This scrapes article names that're all the OCG cards available in YGO so far. Will need to make this more modular to pull article names from any site's categories later.
from lxml import etree
cards="http://yugioh.wikia.com/api.php?format=xml&action=query&list=categorymembers&cmtitle=Category:OCG_cards&cmprop=title&cmlimit=5000"
ignore=set(["List of unnamed cards", "List of unseen cards"])
cmcontinue=""
titles=[]
querycount=1
@ShadowKyogre
ShadowKyogre / dkms
Created June 3, 2015 20:35
OpenRC services
#!/usr/bin/openrc-run
depend() {
need localmount
after net
}
start() {
/usr/lib/systemd/scripts/dkms start
}
#!/bin/bash
if [[ -z $@ ]]; then
echo 'packages list is missed'
echo 'run ./import-to-aur4.sh pack1 pack2 pack3'
exit
fi
mkdir aur4
cd aur4
@ShadowKyogre
ShadowKyogre / predict_voc.py
Last active September 20, 2015 00:09
Swisseph routine to calculate VoC. Pardon me for being lazy for not copypastaing the functions from chronoslnx that it's using in here
from chronoslnxlib.core import *
def predict_voc(cur_date):
cycles = date_to_moon_cycles(cur_date)
moon_pos = swisseph.calc_ut(datetime_to_julian(cur_date), swisseph.MOON)[0]
closest_sign = (( moon_pos // 30 ) + 1) * 30
lower_sign = ( moon_pos // 30 ) * 30
#print(moon_pos, closest_sign)
lower_cycles = cycles+(angle_sub(lower_sign, moon_pos)/360)
cycles += (closest_sign - moon_pos) / 360
@ShadowKyogre
ShadowKyogre / batch_keys.sh
Last active April 22, 2017 20:09
Select multiple windows with slop. Needs slop, xwininfo, and xprop. Edit batch_keys.sh if you want to pass different params to the slop wrapper.
#!/bin/bash
happened=1
for window in $(recsel_windows.py -l -c 0,0.5,1,0.6)
do
happened=0
xdotool windowactivate --sync $window key "$1"
done
if [ $happened -a -n "$2" ];then
@ShadowKyogre
ShadowKyogre / README.md
Last active November 19, 2015 02:39
A Python3 frontend to mutagen (for ID3 tags only, since I needed something like mp3info -i, but less deficient)

Demonstration

asciicast

@ShadowKyogre
ShadowKyogre / cmus_edit_tags.sh
Created November 19, 2015 03:54
Some of my handy personal CMUS scripts
#!/bin/bash
file="$(cmus-remote -C 'echo {}')"
if [ -f "$file" ]
then
lxterminal -t "Editing tags for $file" -e ~/bin/mutagen_urwid.py "$file" &
else
echo "Oop, couldn't find selected track" >&2
fi
@ShadowKyogre
ShadowKyogre / termite2fbterm.sh
Last active December 4, 2015 00:09
termite -> fbterm escape codes. Could be extended to also handle porting Xdefaults too.
#!/bin/bash
for num in {0..15};do
color="$(grep "^color${num}\s\+" "${1:-${HOME}/.config/termite/config}"|grep -o "[0-9a-f]\{3,6\}$")"
rhex="${color:0:2}"
ghex="${color:2:2}"
bhex="${color:4:2}"
r="$((0x${rhex}))"
g="$((0x${ghex}))"
@ShadowKyogre
ShadowKyogre / README.md
Last active December 9, 2015 23:58
Experimental Compiz/Fusilli patches! Tread with caution!

Experimental Compiz/Fusilli patches

Welcome! You've likely stumbled across this wondering, "What the heck is this?"

It's a gist of all the patches I've applied to my personal copy of compiz (likely will try to port these to fusilli too). Here's what they do:

  • emerald_no_rmenu.patch: Disable the right-click menu in the decorations. It's rather unsightly since that menu is not as configurable as Compiz-Boxmenu. On an interesting note, when I disabled this, it also disabled Compiz showing