Skip to content

Instantly share code, notes, and snippets.

View ShadowKyogre's full-sized avatar

ShadowKyogre

View GitHub Profile
@ShadowKyogre
ShadowKyogre / carousel-colors.css
Last active August 29, 2015 14:01
Experimental mobile theme. Also includes some carousel code that can be easily accessed with a thumb.
@ShadowKyogre
ShadowKyogre / bookmarksjson2xml.py
Last active August 29, 2015 14:06
Converts (firefox?) bookmark json format to a KeePassX compatible XML for importing.
import os
import json
#import uuid
from urllib.parse import urlparse
import xml.etree.ElementTree as ET
from datetime import datetime, timedelta
#http://stackoverflow.com/questions/12589952/convert-microsecond-timestamp-to-datetime-in-python
epoch = datetime(1970, 1, 1)
#!/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 / gist:3006776
Created June 27, 2012 20:52 — forked from knu/gist:111055
How to mass-rename tags and push them with Git
# Rename tags named foo-bar-#.#.# to v#.#.# and push the tag changes
git tag -l | while read t; do n="v${t##*-}"; git tag $n $t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done
@ShadowKyogre
ShadowKyogre / openastro_portability.patch
Created June 30, 2012 21:58
Improved portability for openastro
diff -aur openastro.org_1.1.25.orig/openastro.py openastro.org_1.1.25.modified/openastro.py
--- openastro.org_1.1.25.orig/openastro.py 2011-09-28 00:17:43 -0700
+++ openastro.org_1.1.25.modified/openastro.py 2012-06-30 14:54:31 -0700
@@ -19,7 +19,7 @@
#basics
import math, sys, os.path, datetime, socket, gettext, codecs, webbrowser
-
+import tempfile
#copyfile
@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